How to get heat maps (color the surface) in Matlab?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I want to develop a heat map of moisture content with color bar like the attachced picture for a rectangular box of length 73''*Width 31''.I have the moisture content from 18 locations in the box.The moisture values at these 18 locations are given with their x and y coordinates in the excel file.These maps need to be generated by using moisture content at the x& y locations and linearly interpolated values in the spacing between the locations. Can anyone help me ?
0 commentaires
Réponse acceptée
Voss
le 14 Mar 2024
T = readtable('heat_map.xlsx','VariableNamingRule','preserve')
nX = numel(unique(T.(1)));
nY = numel(unique(T.(2)));
X = reshape(T.(1),nY,nX);
Y = reshape(T.(2),nY,nX);
Z = reshape(T.(3),nY,nX);
surface(X,Y,Z,'FaceColor','interp','EdgeColor','none')
colormap(flipud(turbo()))
colorbar
xlim([min(X(:)) max(X(:))])
ylim([min(Y(:)) max(Y(:))])
10 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!