How to plot vector time series

9 ビュー (過去 30 日間)
Hyun-Jung Shin
Hyun-Jung Shin 2019 年 3 月 8 日
コメント済み: Hyun-Jung Shin 2019 年 3 月 8 日
Hi
I want to draw vector time series with wind data.
Can I draw vector time series correctly with time, wind direction, and wind speed data?
First, I used the quiver function, but it was automatically resized. I saw the wrong y-axis of the plot.
The feather function was able to put the vector image exactly but not time.
Next, we found that the auto-resizing function of quiver function can be 'off'.
However, when I used it, the plot was so bad
Please help me. Thanks for reading.
-------------------------------------------------------------------------------------------------------------------------------------
wTime=cat(2,yy,mm,dd,hr,mi,se);
wdatenum=datenum(wTime);
wspeed=data{1,2}
wdir=data{1,3}
wradian=deg2rad(wdir); % change degree to radian
[u,v]=pol2cart(wradian,wspeed);
figure(1)
q=quiver(wdatenum,wdatenum.*0,u,v,0,'k');
q.ShowArrowHead='off';
set(gca,'xlim',[min(wdatenum) max(wdatenum)],'fontsize',15);
datetick('x','dd','keepticks','keeplimits');
xlabel('Date (Dec.2018)','fontsize',15)
ylabel('Wind','fontsize',15);
  1 件のコメント
Hyun-Jung Shin
Hyun-Jung Shin 2019 年 3 月 8 日
I found this
q=quiver(wdatenum,wdatenum.*0,u.*0.1,v,0,'k');
and it works. sorry

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

採用された回答

Bjorn Gustavsson
Bjorn Gustavsson 2019 年 3 月 8 日
Sure you can try speed and wind direction as time-series:
subplot(2,1,1)
plot(t,atan2(u,v))
subplot(2,1,2)
plot(t,(u.^2+v.^2).^.5)
hold on
% Perhaps also add plots of your 2 wind-vector components:
plot(t,u)
plot(t,v)
If this presents your data well I cant tell. Try all sorts of things, perhaps an animation of a feather-plot?
HTH

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeVector Fields についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by