How to store a 3-D surf image into a 3-D matrix?
Afficher commentaires plus anciens
I have an 'image' (2D Matrix) of size AxB. The 'surf(image)' command in Matlab generates a 3-D surface image. I would like to store the generated 3-D surface image in a single 3-D matrix say 'image3D' of size AxBxC; thus it can be used for additional operations. 'C' here is the size pertaining to the dimension in the Z direction, and it has to do with the individual pixel values in the original 'image'.
Is there a feasible way to do this in Matlab?
Réponses (2)
Wayne King
le 10 Mai 2012
I am not sure I understand your question. If you input a 2-D matrix into surf() then the values of your matrix are the values plotted by surf. You can get the 'ZData' from the surf() plot, but that will be the same as your input matrix.
x = randn(20,20);
h = surf(x);
x1 = get(h,'ZData');
isequal(x,x1)
1 commentaire
Khalid
le 11 Mai 2012
Khalid
le 11 Mai 2012
Catégories
En savoir plus sur Contour Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!