ndimgrid(bounds,steps)
Similar to the meshgrid() function, this script will return a matrix where each row is a point in n-dimensional space.
Bounds specifies the limits of the grid in each dimension, steps specifies the number of points in each dimension.
example:
bounds = [1, 1; 5,5];
steps = [5 , 5];
Grid = ndimgrid(bounds,steps);
Grid =
1 1
2 1
3 1
4 1
5 1
1 2
2 2
3 2
4 2
5 2
1 3
2 3
3 3
4 3
5 3
1 4
2 4
3 4
4 4
5 4
1 5
2 5
3 5
4 5
5 5
Hope this helps someone else
Cite As
Rod (2024). ndimgrid(bounds,steps) (https://www.mathworks.com/matlabcentral/fileexchange/55464-ndimgrid-bounds-steps), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > Mathematics > Linear Algebra >
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.