How can I calculate the modulus and argument for every point in a plot?
4 次查看(过去 30 天)
显示 更早的评论
Hi all,
Suppose, I have a scattered plot like this -
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!