In matlab docs for alphaShape plot there is not a way to specify the axis to plot on.
x = [0 1 0 1 0 1 0 1];
y = [0 0 0 0 1 1 1 1];
z = [0 0 1 1 0 0 1 1];
shp = alphaShape(x', y', z', 1);
plot(shp)
Code above works fine, but trying to specify an axes throws error:
ax = axes;
plot(ax, shp)
Any solution?

 採用された回答

Juan Jose
Juan Jose 2024 年 11 月 10 日

0 投票

nevermind, found the solution:
[tri, pts] = boundaryFacets(shp);
trisurf(tri, pts(:,1), pts(:,2), pts(:,3), 'Parent', ax);

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2024 年 11 月 10 日

0 投票

plot(shp, 'Parent', ax)

カテゴリ

ヘルプ センター および File ExchangeBounding Regions についてさらに検索

製品

リリース

R2024b

タグ

質問済み:

2024 年 11 月 10 日

回答済み:

2024 年 11 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by