MATLAB Examples

This is an example of how to create a polar plot in MATLAB®.

Read about the polarplot function in the MATLAB documentation. This function is available in R2016a or newer.

For more examples, go to MATLAB Plot Gallery

% Check version
if verLessThan('matlab','9.0')
    error(['polarplot is available in R2016a or newer. ', ...
        'For older releases, use polar instead.'])

% Create data for the function
t = 0:0.01:2*pi;
r = abs(sin(2*t).*cos(2*t));

% Create a polar plot using the function polarplot
polarplot(t, abs(sin(2*t).*cos(2*t)))

% Add a title