
Polar Plot RLim Not Working
15 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Jon Ho
el 1 de Feb. de 2022
Comentada: Simon Chan
el 1 de Feb. de 2022
I am currently plotting a graph of a certain radiation pattern. I do not want any negative radius values to be plotted. To "recitfy" this situationl, I utilized rlim. However, Negative values are still appearing. Thanks in advance.
This is my code:
theta = linspace(-10*pi,10*pi,10000);
rho = 10.*log10((cos(theta)).^9) + 30;
polarplot(theta, rho);
rlim([0 30]);
This is the graph: I do not wish to see the top and bottom lobes.

0 comentarios
Respuesta aceptada
Simon Chan
el 1 de Feb. de 2022
Determine the index for non-negative number of rho only.
Beware your data are complex number.
theta = linspace(-10*pi,10*pi,10000);
rho = 10.*log10((cos(theta)).^9) + 30;
idx.pos = rho>=0; % Determine non-negative rho
polarplot(theta(idx.pos), rho(idx.pos));

4 comentarios
Simon Chan
el 1 de Feb. de 2022
Yes, the shape is the same.
Function polarpattern provides interactive data visualization and measurement.
Más respuestas (0)
Ver también
Categorías
Más información sobre Polar Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
