How can I calculate the modulus and argument for every point in a plot?
2 ビュー (過去 30 日間)
古いコメントを表示
Hi all,
Suppose, I have a scattered plot like this -
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1347949/image.png)
I want find out the θ, and r for every corresponding point. Can anyone please give me an idea on how to do that?
The X, Y values are in XY.mat file I added. Where,
X = xy(:,1);
Y = xy(:,2);
Any feedback will be highly appreciated!
0 件のコメント
採用された回答
Walter Roberson
2023 年 4 月 6 日
[theta, r] = cart2pol(X, Y);
2 件のコメント
Walter Roberson
2023 年 4 月 6 日
The values are calculated relative to (0,0) . If you want to calculate relative to some other point, subtract that other point from X and Y .
theta = atan2(Y, X) and so is radians.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Scatter Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!