MATLAB: Filtering a wind direction vector by a wind magnitude vector

filtering vectorswind direction

I have a set of time series data of wind magnitude and direction.
I want plot the wind direction over a certain wind magnitude (5 m/s) on a rose plot.
How can I create a new vector that gives only the wind direction when then magnitude is greater than 5 m/s?
Logically something like…
if wndSpeed < 5.0
wndDirection == NaN
end
Open to any solutions!
Thanks

Best Answer

Use logical addressing...
ix=(wndSpeed>=5.0);
data=[wndSpeed(ix) wndDirection(ix)]; % keep desired
Use time vector same indices to match...
Related Question