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
引用格式
Rod (2024). ndimgrid(bounds,steps) (https://www.mathworks.com/matlabcentral/fileexchange/55464-ndimgrid-bounds-steps), MATLAB Central File Exchange. 检索时间: .
MATLAB 版本兼容性
平台兼容性
Windows macOS Linux类别
- MATLAB > Mathematics > Linear Algebra >
标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!