For instance, if I have got a vector describing a rectangle
xy=[165 88;
401 88;
401 278;
165 278];
on an image.
How can I obtain the following vector
[165 88; % increase X - hold y
166 88;
167 88;
... ;
399 88;
400 88;
401 88; % hold x - increase y
401 89;
401 90;
401 91;
... ;
401 276;
401 277;
401 278; % decrease X - hold y
400 278;
399 278;
398 278;
... ;
167 278;
166 278;
165 278; % hold x - decrease y
165 277;
165 276;
... ;
165 87];
using a MATLAB inbuilt function or do I need to write it using FOR LOOPS?
The algorithm must work for a generic vector with n-points and xy coordinates.