How to get heat maps (color the surface) in Matlab?
3 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
Voss
2024 年 3 月 14 日
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 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!