How can I plot a 12x12x12 matrix with a point in [1,1,1 ] , [1,1,2] , etc
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
I am struggling between the scatter3, the plot3 and the meshgrid so any income provided will be awesome
I would like to plot a 12x12x12 matrix with a single point/dot in ALL the coordinates. As a meshgrid but in 3D..
Any ideas?
1 Commento
Jan
il 6 Dic 2017
Does "a 3 dimension 12 size matrix" mean a [3 x 12] matrix? "12x12x12 matrix" is something else. Please explain again (by editing the question, not in a comment), what your inputs are.
Risposte (1)
Benjamin Kraus
il 6 Dic 2017
I can interpret your question in two different ways.
For example:
M = zeros(12,12,12);
M(3,2,5) = 1;
isosurface(M, 0.5);
[X,Y,Z] = meshgrid(1:12);
plot3(X(:),Y(:),Z(:),'.');
Note: I am combining two steps here:
X = X(:);
Y = Y(:);
Z = Z(:);
This converts the matrices into column vectors instead of matrices, as plot3 does not accept 3D matrices.
0 Commenti
Vedere anche
Categorie
Scopri di più su Surface and Mesh Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!