How can I get the wind speed and direction values from u and v components?

22 ビュー (過去 30 日間)
Ahmed Harun-Al-Rashid
Ahmed Harun-Al-Rashid 2016 年 7 月 2 日
回答済み: Star Strider 2016 年 7 月 2 日
As the quiver function shows speed and direction by arrows, there might be a built in function to get the speed and direction values.
Could anyone help please.

採用された回答

Star Strider
Star Strider 2016 年 7 月 2 日
The ‘u’ and ‘v’ are the ‘x’ and ‘y’ components of the plotted vector. To get the magnitude, use the hypot function, and to get the direction, use the atan2 function. You can use these little utility functions to convert the atan2 or atan2d output to [0,p2*pi] or [0,360] representation:
Angles360 = @(a) rem(360+a, 360); % For ‘atan2d’
Angles2pi = @(a) rem(2*pi+a, 2*pi); % For ‘atan2’
These results will correspond to the mathematical convention for angle orientation, not the compass convention.

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 7 月 2 日
If you have an existing quiver plot, then you can extract is UData and VData properties.
However, if you have an existing quiver plot it is usually easier to just take a copy of the u and v data that you used to create the plot.

カテゴリ

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