how to plot data with resepect to height vs time .?

hi, friends I am kind of stuck here. I am trying to plot some radar data. I have managed to average it over a single point. now i have this mat file.(attached)
first-row date and time are given after the word MRR. the second row is height in meters and the third row is rainfall in millimeters.
I have attached one .jpg file which is generated through instrument software.I want to plot the same thing but using Matlab.
second question:(also, I am curious if I could limit the height say up to 1000 meter. ?) I am working on this thing from last week but not able to complete it yet.

1 comentario

below code might help you. you can ignore this code if you have another logic to read that data.
t = char(data(1:3:end));
t = datetime(t(:, 5:16), 'InputFormat', 'yyMMddHHmmss');
rf = cellfun(@(x) str2num(x(3:end)), data(3:3:end), 'UniformOutput', 0);
rf = cellfun(@(x) [x nan(1, 31-numel(x))], rf, 'UniformOutput', 0);
rf = num2cell(cell2mat(rf), 1);
ht = cellfun(@(x) str2num(x(3:end)), data(2:3:end), 'UniformOutput', 0);
ht = cellfun(@(x) [x nan(1, 31-numel(x))], ht, 'UniformOutput', 0);
ht = num2cell(cell2mat(ht), 1);

Iniciar sesión para comentar.

 Respuesta aceptada

KSSV
KSSV el 29 de Mayo de 2018
x = 1:length(t) ;
y = unique(cell2mat(ht)) ;
Z = cell2mat(rf) ;
[X,Y] = meshgrid(x,y) ;
pcolor(X,Y,Z')
colorbar
shading interp

4 comentarios

pruth
pruth el 29 de Mayo de 2018
Editada: pruth el 29 de Mayo de 2018
thank you very much for your reply. I tried this code, it is giving me this plot(attached)
however, I am not sure if in the figure x-axis is a date and time.?? how to get dates-time on the x-axis? plus in the figure data is showing in white color but there is no white color in colorbar ?what about it ?
KSSV
KSSV el 29 de Mayo de 2018
As of now x_axis is the index of time....you can put time using datetick and/or xticklabels.
The white gaps are due to NaN's present in your data.
KSSV
KSSV el 29 de Mayo de 2018
You need to read documentation buddy....
pruth
pruth el 29 de Mayo de 2018
okay !! thanks anyway.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Graphics en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 29 de Mayo de 2018

Editada:

el 29 de Mayo de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by