Azimut angles comparison for wind (position differences in a vector)
显示 更早的评论
Hi
I want to compare 2 datasets of azimutal wind directions and I want to know how to get the real resisdual between the 2 values being compared.
For example:
If I have a 345° modelised data (data1) and a 15° observed data (data2), I can't do data1 - data2 because it gives me 330° and not 30° who should be the real residual value.
I think it might work by calculating the umber of positions difference between the 2 data in a vector (to limit the number values of residual to 360), but I don't know how to do it.
I hope I'm clear !
Any other idea would be welcome !!
Thanks a lot
回答(1 个)
Roger Stafford
2015-1-12
Presumably you want a difference that lies between 0 and 180, as would be true for the inner angle of any triangle.
a = mod(data1-data2,360);
a = min(a,360-a);
类别
在 帮助中心 和 File Exchange 中查找有关 PHY Components 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!