MATLAB: Time series with quiver

quivertime series

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?

Best Answer

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
Related Question