フィルターのクリア

3D plot where x and y has different length

6 ビュー (過去 30 日間)
mingcheng nie
mingcheng nie 2022 年 12 月 20 日
回答済み: KSSV 2022 年 12 月 20 日
Hi there,
If I want to plot a 3D surface with x,y,z variables, where x and y has diffrent length, then which function should I use? I saw most of plot require that x and y has same length.
  1 件のコメント
Dyuman Joshi
Dyuman Joshi 2022 年 12 月 20 日
And how would that plot be? If you wanted to plot it with pen and paper, how would you do it?

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

採用された回答

KSSV
KSSV 2022 年 12 月 20 日
For a 3D plot (x,y) can have different lengths, if you are talking about pcolor, surf. HEre you are plotting a surface.
x = linspace(0,1,20) ;
y = linspace(0,1,30) ;
[X,Y] = meshgrid(x,y) ;
Z = sqrt(X.^2+Y.^2) ;
pcolor(X,Y,Z)

その他の回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by