
3d plot with different length of x and y
조회 수: 8 (최근 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!