Using impoly on a surface plot.

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 日

3 投票

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?

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeGraphics Object Properties についてさらに検索

質問済み:

2016 年 10 月 6 日

コメント済み:

2016 年 10 月 6 日

Community Treasure Hunt

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

Start Hunting!

Translated by