How to write a range of coordinates (of an area)
5 views (last 30 days)
Show older comments
Yuk Wai Kelvin Chow
on 19 Feb 2021
Commented: Yuk Wai Kelvin Chow
on 19 Feb 2021
I want to get a range of coordinate (x,y) for further calculation of distance between them and a specific points
For example a floor plan of 50x20, how can i get all the points ?in a form of matrix?
Width=50
Length=20
x=[0:Width]
y=[0:Length];
0 Comments
Accepted Answer
Walter Roberson
on 19 Feb 2021
Width=5;
Length=3;
x = 0:Width;
y = 0:Length;
[X,Y] = ndgrid(x,y);
XY = [X(:), Y(:)];
disp(XY)
More Answers (0)
See Also
Categories
Find more on Spline Postprocessing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!