필터 지우기
필터 지우기

Is it possible to get the exact 2D image of the CData matrix of surf plot?

조회 수: 3 (최근 30일)
Rafi Ahmed
Rafi Ahmed 2019년 3월 9일
댓글: Rafi Ahmed 2019년 3월 9일
I have a matlab 3D plot(attached figure). I want to extract the 2D image from the surf plot of matlab like this:
fd45_az0.JPG
is it possible?

답변 (1개)

Walter Roberson
Walter Roberson 2019년 3월 9일
The X data in the graphics object is irregularly spaced, forming a sine wave. Therefore we cannot simply take the ZData or CData properties and build a matrix from there.
You will need to getframe() the axes and write that to file.
Alternately if you use export_fig from the File Exchange then it can write more directly to file.
  댓글 수: 1
Rafi Ahmed
Rafi Ahmed 2019년 3월 9일
Thanks for your reply. The size of the image is 360 by 360. Export_fig can get the file but it changes the size of the image.
can i use getframe like this:
drawnow
ax = gca;
ax.Units = 'pixels';
ti = ax.TightInset;
F = getframe(ax,[-ti(1), -ti(2), 360 ,360]);
imshow(F.cdata)
but it is not working. Please help me.

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

카테고리

Help CenterFile Exchange에서 Graphics Object Properties에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by