Using impoly on a surface plot.

조회 수: 11 (최근 30일)
Thorsten Becker
Thorsten Becker 2016년 10월 6일
댓글: Thorsten Becker 2016년 10월 6일
I would like to use Matlab's impoly (or any of the imroi functions) on a 3D surface. However, there seems to be a problem when calling createMask.
[X,Y,Z] = peaks(101);
surf(X,Y,Z);
h = impoly(gca);
mask = createMask(h);
Interesting is that this works.
pos = getPosition(h)
Any help would be much appreciated.

답변 (1개)

Massimo Zanetti
Massimo Zanetti 2016년 10월 6일
After launching your code, click on the sufrace and impoly will work.
  댓글 수: 1
Thorsten Becker
Thorsten Becker 2016년 10월 6일
I don't follow.
This part of the example works fine:
[X,Y,Z] = peaks(101);
surf(X,Y,Z);
h = impoly(gca);
However, when I call
mask = createMask(h);
I get the following error: Error using imroi/parseInputsForCreateMask (line 103) createMask expects a current figure containing an image.
Is there a way around this?

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

카테고리

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