how to transfer a surf generated 3D image into 2D array

Hi, I wanted to know if there is a method to transfer the ZData of a 3D surf generated image to a 2D array. for ex, Lets say i have a 2D array A=[ 0 0 0 0; 0 0 2 0 0; 0 3 5 4 0; 0 0 2 0 0; 0 0 0 0 0] i created a Figure(Fig1) using Surf(A), now i want to transfer the contents of ZData of Fig1(say modified a bit) to a new 2D array B. I have tried B=get(Fig1,'ZData') but it gives out a error "undefined function or variable Fig1. is there any method to achieve this operation? Thanks.

 채택된 답변

Sean de Wolski
Sean de Wolski 2013년 6월 19일
편집: Sean de Wolski 2013년 6월 19일
hF = figure;
ax = axes;
S = surf(peaks);
ZD = get(S,'ZData');
The 'ZData' lives in the surface object which is a child of the axes which is a child of the figure.

댓글 수: 1

Bharath
Bharath 2013년 6월 19일
편집: Bharath 2013년 6월 19일
Hi Sean, Thank you very much for your suggestion. S.Bharath

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by