vector direction calculation in order to remove impact of magnitude

4 ビュー (過去 30 日間)
Kh. Dola
Kh. Dola 2021 年 7 月 2 日
回答済み: Paul 2021 年 7 月 2 日
I hav two datasets of velocity such as u and v. I am using quiver to plot 2d vector. But those data magnitude varies much that's why resultant vectors are usually too small. Since i don't need vector's magnitude. I want to calculate directions of u and v individually and then try it on quiver to make my vectors long enough. How to do that that.

回答 (1 件)

Paul
Paul 2021 年 7 月 2 日
I think you want something like this:
mag = sqrt(u.^2 + v.^2);
newu = u./mag;
newv = v./mag;
% now use newu and newv as inputs to quiver

カテゴリ

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