How to color a mesh by temperature(or other value) preserving the elevation. Using two matrix(same length)

10 visualizaciones (últimos 30 días)
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.untitled.jpg
  1 comentario
Adam Danz
Adam Danz el 4 de Dic. de 2019
Editada: Adam Danz el 4 de Dic. de 2019
Not sure if your plot is 3D or 2D. Maybe this will get you started (links below)
---[Update after your question-update]---
  1. Which function did you use to produce the 3D plot?
  2. 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?

Iniciar sesión para comentar.

Respuesta aceptada

Fabio Freschi
Fabio Freschi el 4 de Dic. de 2019
% 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

Más respuestas (0)

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Productos


Versión

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by