フィルターのクリア

How to get heat maps (color the surface) in Matlab?

3 ビュー (過去 30 日間)
Md Sadiq
Md Sadiq 2024 年 3 月 14 日
コメント済み: Voss 2024 年 3 月 15 日
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 ?

採用された回答

Voss
Voss 2024 年 3 月 14 日
T = readtable('heat_map.xlsx','VariableNamingRule','preserve')
T = 18×3 table
Length (x) width (y) Moisture Content (%) __________ _________ ____________________ 12 10 15 12 20 15.23 12 30 15.46 24 10 15.69 24 20 15.92 24 30 16.15 36 10 16.38 36 20 16.61 36 30 16.84 48 10 17.07 48 20 17.3 48 30 17.53 60 10 17.76 60 20 17.99 60 30 18.22 72 10 18.45
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 件のコメント
Md Sadiq
Md Sadiq 2024 年 3 月 15 日
移動済み: Voss 2024 年 3 月 15 日
Thank you very much!
Voss
Voss 2024 年 3 月 15 日
You're welcome!

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by