How to plot entire row of numerical matrix from corresponding logical array?
Show older comments
I have a 176496x3 double numerical matrix (A) comprised of 3D coordinate point data. I used the 'ischange' function on matrix A - the output is a 176496x3 logical matrix (A_changed). From there I isolated the nonzero points and was given a 467x1 logical matrix (A_nonzero).
The 467 nonzero values correspond to 467 values detected by the 'ischange' funtion. The values are not full coordinate points.
How can I plot (on a 3D plane), not just the 467 individual coordinates, but the entire rows (xyz-coordinate/3D point) that they come from?
An example of what I mean:
A =
[0.220, 0.0095, -0.2745;
0.2210, 0.009, -0.2744;
0.2218, 0.009, -0.2745;
0.2215, 0.0095, -0.2744;
0.2215, 0.0085, -0.2743]
A_changed =
[0, 0, 0;
0, 1, 1;
0, 1, 0;
1, 0, 1;
0, 0, 1]
A_nonzero =
[1;
1;
1;
1;
1;
1]
In this example, I want to plot
A_final =
[0.2210, 0.009, -0.2744;
0.2218, 0.009, -0.2745;
0.2215, 0.0095, -0.2744;
0.2215, 0.0085, -0.2743]
Additionally, here is the code I'm using:
% The data is imported from a file titled Drill
A = Drill;
A_changed = ischange(A, 'linear', 'Threshold', 0.01);
B = A_changed > 0;
A_nonzero = A_changed(B);
Attached is a small sample of the data (100 points). I made sure there are at least 5 rows with values detected by the 'ischange' function. I can also provide the full set of data as an .xyz file if that is preferred.
Lastly, I'm using Matlab R2021a.
Accepted Answer
More Answers (0)
Categories
Find more on Surface and Mesh 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!