REVERSEPOLYLINE Reverse a polyline, by iterating vertices from the end. POLY2 = reversePolyline(POLY) POLY2 has same vertices as POLY, but POLY2(i,:) is the same as POLY(END-i+1,:). Example reversePolyline See also polygons2d, reversePolygon ------ Author: David Legland e-mail: david.legland@grignon.inra.fr Created: 2009-06-30, using Matlab 7.7.0.471 (R2008b) Copyright 2009 INRA - Cepia Software Platform.
0001 function rev = reversePolyline(poly) 0002 %REVERSEPOLYLINE Reverse a polyline, by iterating vertices from the end. 0003 % 0004 % POLY2 = reversePolyline(POLY) 0005 % POLY2 has same vertices as POLY, but POLY2(i,:) is the same as 0006 % POLY(END-i+1,:). 0007 % 0008 % Example 0009 % reversePolyline 0010 % 0011 % See also 0012 % polygons2d, reversePolygon 0013 % 0014 % ------ 0015 % Author: David Legland 0016 % e-mail: david.legland@grignon.inra.fr 0017 % Created: 2009-06-30, using Matlab 7.7.0.471 (R2008b) 0018 % Copyright 2009 INRA - Cepia Software Platform. 0019 0020 rev = poly(end:-1:1, :);