How to store a 3-D surf image into a 3-D matrix?
古いコメントを表示
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?
回答 (2 件)
Wayne King
2012 年 5 月 10 日
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)
Khalid
2012 年 5 月 11 日
カテゴリ
ヘルプ センター および File Exchange で Contour Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!