3d plot with different length of x and y

63 ビュー (過去 30 日間)
Lasse Murtomäki
Lasse Murtomäki 2020 年 9 月 25 日
編集済み: KALYAN ACHARJYA 2020 年 9 月 25 日
My x is a vector of length 21 and y a vector of length 101. I have calculated matrix z that is 21 x 101. I want to plot it in 3D. Surf and mesh commands require the same dimensions for the vectors. Is this possible?

採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2020 年 9 月 25 日
編集済み: KALYAN ACHARJYA 2020 年 9 月 25 日
As per the you data sizes, following is also allowed
contour3(x,y,z');
Note: I presumed that x and y are continously increasing or decreasing.

その他の回答 (1 件)

KSSV
KSSV 2020 年 9 月 25 日
surf, pcolor is your function. You can plot using that.
x = 1:21 ;
y = 1:101 ;
Z = rand(21,101) ;
[X,Y] = meshgrid(x,y) ;
surf(X,Y,Z')
shading interp
colorbar

カテゴリ

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