I have a large amount of data to import into MATLAB, representing the location of points in Cartesian space. Which of the following is the most common for storing and processing standard XYZ data ?:
OPTION number 1
Save X, Y, and Z coordinates as separate n * 1 vectors (perhaps inside the structure?). It does:
- Simple laying:
plot3(X, Y, Z) - Extracting individual points is a bit more confusing
N = [X(i), Y(i), Z(i)] - Passing the entire set of points to a function expands the number of arguments passed.
OPTION number 2
Save the X, Y, and Z coordinates as one n * 3 vector.
- Density is a bit trickier:
plot3(XYZ(:, 1), XYZ(:, 2), XYZ(:, 3)) - Extracting individual points is easier:
N = XYZ(i, :) - Passing the entire set of points is easy - just one variable
Based on this, I suspect that the second is more conditional.
, , , , . , n * m * 3, (n * m) * 3. , X (i, j) X (i, j + 1). , :
β 1
X, Y Z n * m.
β 2
n * m * 3.
, , , :
X = XYZ(:, :, 1);
Y = XYZ(:, :, 2);
Z = XYZ(:, :, 3);
plot3(X(:), Y(:), Z(:));
, , .