Create a coordinate system (x, y, z) matrix
21 views (last 30 days)
Show older comments
The idea is to build a dataset of coordinates matrix with 3 coordinates along X, Y, and Z. The data which I have are:
% min and max coordinates of the dataset
Xmin = 388363.3 Xmax = 390229.2
Ymin = 3310114 Ymax = 3311144
Zmin = 2027.96 Zmax = 2889.9
% sub-block size along x, y, z:
dx = 20; dy = 20; dz = 10;
% number of layers along x, y, z:
nx = 95; ny = 53; nz = 88;
The resulting dataset starts with the min values of coordinates and goes up to max coordnates. The result is a matrix with 3 columns X, Y, and Z and the coordinates below, which correspond to the number of layers and sub-block size. And the result if you imagine will look like a big rectange with many subblocks.
I tried with a nested loop with some logic statements, but it is just produce the wrong coordinates. I think that I coded it incorrectly. If you need more info or details, please ask. Thank you for attention.
0 Comments
Accepted Answer
David Hill
on 23 Feb 2022
Edited: David Hill
on 23 Feb 2022
Xmin = 388363.3;
Xmax = 390229.2;
Ymin = 3310114;
Ymax = 3311144;
Zmin = 2027.96;
Zmax = 2889.9;
[X,Y,Z]=meshgrid(linspace(Xmin,Xmax,95),linspace(Ymin,Ymax,53),linspace(Zmin,Zmax,88));
scatter3(X(:),Y(:),Z(:));
3 Comments
More Answers (0)
See Also
Categories
Find more on Data Distribution Plots 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!