Time series with quiver
10 ビュー (過去 30 日間)
古いコメントを表示
Hello all
I'm trying to plot a time series of wind speed and direction using quiver but I can't figure it out. I thought it would be pretty logical but quiver requires (x,y) and I don't have that. My data is from the same wind station over a 40 year period. How would I go about plotting the data as a time series?
1 件のコメント
Rik
2017 年 4 月 21 日
Why do you want to use quivers? Wouldn't two plots with speed and direction separately be more informative?
Otherwise you can still use quiver, but you will have to build it up yourself (start out with regular spaced x values and generate end points based on speed and direction).
採用された回答
Star Strider
2017 年 4 月 21 日
See if this does what you want:
N = 10;
wind_vel = rand(N, 1)*25; % Velocitoy Vector
wind_dir = randi(360, N, 1); % Direction Vector
wind_u = cos(wind_dir).*wind_vel; % Wind ‘x’ Direction
wind_v = sin(wind_dir).*wind_vel; % Wind ‘y’ Direction
wind_w = zeros(N, 1); % Wind ‘z’ Direction
x = zeros(N, 1); % Station Remains Stationary
y = zeros(N, 1); % Station Remains Stationary
t = linspace(0, 25, N)'; % Time
figure(1)
quiver3(x, y, t, wind_u, wind_v, wind_w)
hold on
plot3(x, y, t, '-k', 'LineWidth',2)
hold off
grid on
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Vector Fields についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!