# How can I calculate the modulus and argument for every point in a plot?

3 Ansichten (letzte 30 Tage)
Ashfaq Ahmed am 6 Apr. 2023
Kommentiert: Walter Roberson am 6 Apr. 2023
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 Kommentare-2 ältere Kommentare anzeigen-2 ältere Kommentare ausblenden

Melden Sie sich an, um zu kommentieren.

### Akzeptierte Antwort

Walter Roberson am 6 Apr. 2023
[theta, r] = cart2pol(X, Y);
##### 2 KommentareKeine anzeigenKeine ausblenden
Ashfaq Ahmed am 6 Apr. 2023
Bearbeitet: Ashfaq Ahmed am 6 Apr. 2023
Yes, perfect! Does it count from the first element? Also, how is the theta calculated (i.e., its dimension)?
Walter Roberson am 6 Apr. 2023
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.

Melden Sie sich an, um zu kommentieren.

### Kategorien

Mehr zu Scatter Plots finden Sie in Help Center und File Exchange

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by