Why don't you share the text file.....it can be even viewed with functions like surf, pcolor.
How do I visualize a matrix of values?
2 次查看(过去 30 天)
显示 更早的评论
I have a dataset with temperatures from an rotating cylinder. I have got some help to visualize it like a flat heatmap. Can someone show me some more examples of different ways to visualize the dataset?
filename = ['data\\day\\' 'filenames.txt'];
T = readtable(filename);
tsize = size(T);
tsize (1);
filename = strcat('data\\day\\', string(T{100,1}));
map100 = getHeatMap(filename);
filename = strcat('data\\day\\', string(T{1000,1}));
map1000 = getHeatMap(filename);
k=imshow([map100]);
colormap(gca, 'jet');
k=imshow([map1000]);
colormap(gca, 'jet');
function heat = getHeatMap(filename)
s = dir(filename);
fin=fopen(filename,'r');
I=fread(fin,s.bytes,'uint8=>uint8');
w = uint16(I(1))+256*uint16(I(2));
h = uint16(I(3))+256*uint16(I(4));
skip = s.bytes - w*h + 1;
IN = I(skip:1:s.bytes);
Z=single(reshape(IN,w,h));
Z=griddedInterpolant(Z');
y_range = linspace(1.0,single(h),360);
x_range = linspace(1.0,single(w),512);
heat = uint8(Z({y_range, x_range}));
fclose(fin);
end
This code produces an image like this:
But I have no clue of how to proceed to get other ways to show the image. The goal is to be able to make it easier to detect areas where the temperature is higher than "normal" data_file
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Distribution Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!