Show temperature differences in a dataset
Mostrar comentarios más antiguos
I have a data-set with 360*512*237 temperature readings. The actual readings is 360*512 and there are 237 readings.
I want to visualize in some nice way using a slider or other method where the temperatures fluctuate the most for example. Can anyone tell me different methods for visualizing this data.
This is the code I got for now:
if exist('matrix_values_year.mat', 'file') == 2
load('matrix_values_year.mat');
else
file = dir('data\\year\\*.OTT');
measure_matrix = [];
for i = 1:size(file, 1)
if file(i).bytes <= 2000 | file(i).bytes > 70000 ;
measure_matrix = cat(3,measure_matrix,measure_matrix(:,:,i-1));
else
filnamn = string(strcat(file(i).folder,{'\'},file(i).name));
measure_matrix = cat(3,measure_matrix,getHeatMap(filnamn));
end
end
save matrix_values_year.mat measure_matrix;
end
max_difference = 0
measure_matrix = rescale(measure_matrix,50,450, 'InputMin', 0,'InputMax',255);
column_matrix = zeros(512,237);
x=0;
y=0;
for i=1:237
for j=1:512
differance = (max(measure_matrix(:,j,i)) - min(measure_matrix(:,j,i)));
column_matrix(j,i) = differance;
if( differance > max_difference )
max_difference = differance;
x=i;
y = j;
end
end
end
sample = measure_matrix(:,:,50);
figure
h= histogram(column_matrix)
figure
mesh(column_matrix')
view(-15,20)
function heat = getHeatMap(filename_s)
s = dir(filename_s);
fin=fopen(filename_s,'r');
I=fread(fin,s.bytes,'uint8=>uint8');
fclose(fin);
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}));
end
Respuesta aceptada
Más respuestas (1)
Cliff Karlsson
el 24 de Oct. de 2018
3 comentarios
jonas
el 24 de Oct. de 2018
See my updated answer
Cliff Karlsson
el 26 de Oct. de 2018
Editada: Cliff Karlsson
el 26 de Oct. de 2018
jonas
el 26 de Oct. de 2018
I've updated the script.
Categorías
Más información sobre Surfaces, Volumes, and Polygons en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!