MATLAB Examples

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

Read about the polarhistogram function in the MATLAB documentation. This function is available in R2016b or newer.

For more examples, go to MATLAB Plot Gallery

% Check version
if verLessThan('matlab','9.1')
    error(['polarhistogram is available in R2016b or newer. ', ...
        'For older releases, use rose instead.'])

% Load sunspot data
load sunspotData sunspot

% Create a polar histogram with 24 sectors
polarhistogram(sunspot, 24)

% Add title
title('Sunspot Frequency')