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