MATLAB: Plotting polar graphs with Matlab

figuregraphplotplottingpolar

Hi, I am using Matlab to generate symmetric polar plots on the lower half of the circle (i.e. 0-83 degrees and 277-360 degrees).
h = polar(phi,rho)
where phi and rho are input text files.
In this case, Matlab connect the point of (phi_83,rho_83) to (phi_277,rho_277) with one straight line. How can I modify it so that they don't get connected?
Thanks a lot, Bahar

Best Answer

You have to break them up into two separate plot calls, and use the hold function:
phi = [linspace(0, 83) linspace(277, 360)]*pi/180; % Create Data

rho = abs(sin(6.5*phi)); % Create Data
figure(1)
polar(phi(1:100), rho(1:100))
hold on
polar(phi(101:200), rho(101:200))
hold off
The linspace function creates a 100-element vector by default. You can change that with a third argument, but you would have to change the subscripts in the polar calls to match the new vector lengths.
Related Question