Mercurial > hg > camir-aes2014
annotate toolboxes/FullBNT-1.0.7/KPMtools/plot_polygon.m @ 0:e9a9cd732c1e tip
first hg version after svn
author | wolffd |
---|---|
date | Tue, 10 Feb 2015 15:05:51 +0000 |
parents | |
children |
rev | line source |
---|---|
wolffd@0 | 1 function out=plot_polygon(p, args, close_loop) |
wolffd@0 | 2 % PLOT_POLYGON |
wolffd@0 | 3 % function handle=plot_polygon(p, args, close_loop) |
wolffd@0 | 4 % p(1,i), p(2,i) are the x/y coords of point i. |
wolffd@0 | 5 % If non-empty, args are passed thru to the plot command. |
wolffd@0 | 6 % If close_loop = 1, connect the last point to the first |
wolffd@0 | 7 |
wolffd@0 | 8 % All rights reserved. Documentation updated April 1999. |
wolffd@0 | 9 % Matt Kawski. http://math.la.asu.edu/~kawski |
wolffd@0 | 10 % He calls it pplot |
wolffd@0 | 11 |
wolffd@0 | 12 if nargin < 2, args = []; end |
wolffd@0 | 13 if nargin < 3, close_loop = 0; end |
wolffd@0 | 14 |
wolffd@0 | 15 if close_loop |
wolffd@0 | 16 p = [p p(:,1)]; |
wolffd@0 | 17 end |
wolffd@0 | 18 |
wolffd@0 | 19 if isempty(args) |
wolffd@0 | 20 out=plot(p(1,:),p(2,:)); |
wolffd@0 | 21 else |
wolffd@0 | 22 out=plot(p(1,:),p(2,:),args); |
wolffd@0 | 23 end |