Problem to get the right format of a Surf Plot

3 ビュー (過去 30 日間)
Cb
Cb 2021 年 2 月 26 日
コメント済み: Star Strider 2021 年 3 月 8 日
I am trying to plot a surface. What I need is the surface that is on top, but I keep getting the two surfaces underneath. Is there any reason why this is happening?
BB = [TBfunc1;TBfunc2]
X = [BB(:,1)]
Y = [BB(:,3)]
Z = [BB(:,2)]
[xi, yi] = meshgrid(X,Y);
F = scatteredInterpolant(X,Y,Z)
zi = F(xi,yi)
surf(xi,yi,zi, 'EdgeAlpha', 0)

採用された回答

Star Strider
Star Strider 2021 年 2 月 26 日
It looks as though ‘X’ is not sorted. Without the data a guess would be this possible solution:
BB = sortrows (BB,1);
See the documentation on sortrows for details.
  6 件のコメント
Cb
Cb 2021 年 3 月 8 日
Thank you again, for your support! I managed to fix it by myself. Is was an issue with the meshgrid size.
Star Strider
Star Strider 2021 年 3 月 8 日
As always, my pleasure!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by