Daniel@0: function out=plot_polygon(p, args, close_loop) Daniel@0: % PLOT_POLYGON Daniel@0: % function handle=plot_polygon(p, args, close_loop) Daniel@0: % p(1,i), p(2,i) are the x/y coords of point i. Daniel@0: % If non-empty, args are passed thru to the plot command. Daniel@0: % If close_loop = 1, connect the last point to the first Daniel@0: Daniel@0: % All rights reserved. Documentation updated April 1999. Daniel@0: % Matt Kawski. http://math.la.asu.edu/~kawski Daniel@0: % He calls it pplot Daniel@0: Daniel@0: if nargin < 2, args = []; end Daniel@0: if nargin < 3, close_loop = 0; end Daniel@0: Daniel@0: if close_loop Daniel@0: p = [p p(:,1)]; Daniel@0: end Daniel@0: Daniel@0: if isempty(args) Daniel@0: out=plot(p(1,:),p(2,:)); Daniel@0: else Daniel@0: out=plot(p(1,:),p(2,:),args); Daniel@0: end