Add arrows to surface plot to represent wind direction
13 ビュー (過去 30 日間)
古いコメントを表示
Hi there,
I am seeing a lot of information about the quiverm function but I only have my wind direction data in degrees and not in the u and v components. Is there a simple way to project a matrix of wind direction values (360 degrees) onto a sufacem plot? Perhaps there is a way to add and arrow and align it based on the wind direction value? I do not want to add magnitude as well, just direction.
Many thanks,
7 件のコメント
Kirby Fears
2015 年 9 月 23 日
-179 is the correct answer.
-179+360=181
The NCL website adds 180 to this, which would be
-179+180=1, which is incorrect.
採用された回答
Kirby Fears
2015 年 9 月 23 日
編集済み: Kirby Fears
2015 年 9 月 23 日
I'm posting an example as described in my earlier comment.
Code below creates a 10x10 grid of arrows that are all pointing at 120 degrees.
x=repmat(1:10,10,1);
y=x';
deg=120; % all points have same direction
% if you have a degree array the same size as x,
% you can use cosd and sind on "deg" without
% using repmat after
u=repmat(cosd(deg),size(x));
v=repmat(sind(deg),size(x));
% you can multiply u and v by magnitude of required
quiver(x,y,u,v);
5 件のコメント
その他の回答 (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!