- Which function did you use to produce the 3D plot?
- I understand that you used array Z to produce the plot but you want the color scale to be based on another variable T, of equal size to Z. Is that correct? Could you provide the dimension of both variables just to confirm that?
How to color a mesh by temperature(or other value) preserving the elevation. Using two matrix(same length)
조회 수: 13 (최근 30일)
이전 댓글 표시
I have a mesh that plots a terrain with values in a matrix Z(NxN), i need to color this whit the temperature value in every heigth set in another matrix with same length T(NxN) preserving the corresponding elevation.So my problem is that it only colors depending on the height.
댓글 수: 1
Adam Danz
2019년 12월 4일
편집: Adam Danz
2019년 12월 4일
Not sure if your plot is 3D or 2D. Maybe this will get you started (links below)
---[Update after your question-update]---
채택된 답변
Fabio Freschi
2019년 12월 4일
% dummy data
[X,Y] = meshgrid(1:0.5:10,1:20);
Z = sin(X).*cos(Y);
T = X+Y;
% plot
surf(X,Y,Z,T)
colormap('hot')
colorbar
댓글 수: 0
추가 답변 (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!