フィルターのクリア

Surface Plot with 3 Matrix (100x100)

3 ビュー (過去 30 日間)
Eren Tatar
Eren Tatar 2021 年 6 月 8 日
コメント済み: Walter Roberson 2021 年 6 月 9 日
Hello, I have three 100x100 matrices. Now I have always shown the visualization with scatter3 (x, y, z). However, I would like to display the plot with the mesh or surface command. Every time I use these commands, however, I get error messages. Could someone help me with this? The plot should look something like the scatter3 command.
  1 件のコメント
SALAH ALRABEEI
SALAH ALRABEEI 2021 年 6 月 8 日
what is the error!

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

回答 (1 件)

Chunru
Chunru 2021 年 6 月 9 日
編集済み: Chunru 2021 年 6 月 9 日
It seems that the data is not on regular grid for mesh and surface command.
For irregular grid, you can consider to interpolate the irregular-grided data for plotting:
F = scatteredInterpolant(x,y,z);
[xq, yq] = meshgrid(xrange, yrange); % define the grid yourselfe
zq = F(xq,yq);
mesh(xq, yq, zq)
  1 件のコメント
Walter Roberson
Walter Roberson 2021 年 6 月 9 日
pcolor() is really just surf() with view() set from above and with the ZData property forced to all 0.
That is, any x and y arrays that work for pcolor() would also work for surf() and so you cannot do more with pcolor() than with surf()
It is valid to use nonlinear points for the X and Y for surf()
[X, Y] = ndgrid(exp(-linspace(0,2*pi)), cos(linspace(0,2*pi)));
Z = sqrt(X.^2 + Y.^2);
surf(X, Y, Z, 'edgecolor', 'none')

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

カテゴリ

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