Educational materials

MATLAB: drawLine

Credit: Dr. Pat Flynn

Source Code

function ln = drawLine(x1, y1, x2, y2, col)
%   usage:    h = drawLine (x1, y1, x2, y2)
%   alternate:    h = drawLine (x1, y1, x2, y2, ‘color’)
%    purpose:   Draws a line, given two points (x1, y1) and (x2, y2) Returns a handle h, 
%               to the line, i.e. a   variable that can help identify the line being created.
%               The handle can be used by some of the functions below. . If present,
%               color specifies the color of the line.  If not specified, red will be used.

if nargin < 5
    col = 'red'
end

ln = line([x1 x2], [y1 y2], 'Col
r1 - 18 Sep 2007 - 18:22:18 - AaronStriegel
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
Syndicate this site RSSATOM