annotate toolboxes/FullBNT-1.0.7/KPMtools/plot_polygon.m @ 0:cc4b1211e677 tip

initial commit to HG from Changeset: 646 (e263d8a21543) added further path and more save "camirversion.m"
author Daniel Wolff
date Fri, 19 Aug 2016 13:07:06 +0200
parents
children
rev   line source
Daniel@0 1 function out=plot_polygon(p, args, close_loop)
Daniel@0 2 % PLOT_POLYGON
Daniel@0 3 % function handle=plot_polygon(p, args, close_loop)
Daniel@0 4 % p(1,i), p(2,i) are the x/y coords of point i.
Daniel@0 5 % If non-empty, args are passed thru to the plot command.
Daniel@0 6 % If close_loop = 1, connect the last point to the first
Daniel@0 7
Daniel@0 8 % All rights reserved. Documentation updated April 1999.
Daniel@0 9 % Matt Kawski. http://math.la.asu.edu/~kawski
Daniel@0 10 % He calls it pplot
Daniel@0 11
Daniel@0 12 if nargin < 2, args = []; end
Daniel@0 13 if nargin < 3, close_loop = 0; end
Daniel@0 14
Daniel@0 15 if close_loop
Daniel@0 16 p = [p p(:,1)];
Daniel@0 17 end
Daniel@0 18
Daniel@0 19 if isempty(args)
Daniel@0 20 out=plot(p(1,:),p(2,:));
Daniel@0 21 else
Daniel@0 22 out=plot(p(1,:),p(2,:),args);
Daniel@0 23 end