how can I plot a degree variable, a scalar and a date

3 次查看(过去 30 天)
Hi, so I got three variables: one gives me the direcction of the wind every half an hour, another one gives me the value of the wind every half an hour and finally one gives me the date of each information. How could I plot it to see the evolution of it every day? I upload the data I used.

回答(1 个)

KSSV
KSSV 2021-12-6
load('DataRaval.mat')
load('Direcwind.mat')
load('Velwind.mat')
thedates = datestr(DataRaval) ;
theta = DirecVentRaval ;
W = VelVentRaval ;
u = W.*cosd(theta) ;
v = W.*sind(theta) ;
figure(1)
x = (1:length(u))' ;
y = ones(size(x)) ;
quiver(x,y,u,v) ;
xticklabels(thedates)
figure(2)
plot(x,W)
xticklabels(thedates)
  3 个评论
flashpode
flashpode 2021-12-6
why? The problem I got is to graph the degrees not the days. Look this code, it gives me a plot every day
figure(3)
for k = 1:48:numel(PresionRaval)
nexttile
vend = min(k+48,numel(PresionRaval));
plot(datenum(DataRaval(k:vend,1)),PresionRaval(k:vend,1));
datetick('x','HHPM')
xlabel('Hores'),ylabel('Pressió (hPa)')
title(sprintf('Març %d',floor(k/48)+1))
text(0.05,0.95,sprintf('%.3fhPa',mean(PresionRaval(k:vend,1),'omitnan')),...
'units','normalized','verticalalignment','top')
end
sgtitle('Pressió dies de març')
I want the same but with the direccion given. I read about

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by