3d plot with different length of x and y
59 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
采纳的回答
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.
0 个评论
更多回答(1 个)
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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!