How to do polar plot correctly?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
John
am 24 Jun. 2014
Kommentiert: John
am 25 Jun. 2014
The task is to plot each group in different symbol and color and show them at their "angle" location in polar plot. This script was used:
factor = 1.2 * 1e-3;
n = 7;
f = [400 200 -10 -200 -300];
symb = ['ro' 'bd' 'gs' 'm^' 'cv' 'r+' 'bx'];
figure('color','white')
hold on
for nn=1:n
t = (nn-1)*factor;
A = exp(-1i*2*pi*t*f);
[THETA,RHO] = cart2pol(real(A), imag(A));
polar(THETA,RHO,symb(nn))
end
hold off
However this was what it output. Obviously this is not correct, no polar graph and no color symbol. Something must be wrong.
Above, if no color used by using the script below, it plot as the second graph below:
symb = ['o' 'd' 's' '^' 'v' '+' 'x'];
Thank you for pointing out the mistake.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/164721/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/164722/image.jpeg)
0 Kommentare
Akzeptierte Antwort
Dishant Arora
am 24 Jun. 2014
Bearbeitet: Dishant Arora
am 24 Jun. 2014
Define your symb a cell array that is
symb = {'ro' 'bd' 'gs' 'm^' 'cv' 'r+' 'bx'}
To know where you went wrong, check out the echo of following command at command window:
symb = ['ro' 'bd' 'gs' 'm^' 'cv' 'r+' 'bx']
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Polar Plots finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!