%% Plot Data from a Table
% Since R2021b
% A convenient way to plot data from a table is to pass the table to the polarscatter function and specify the variables you want to plot. For example, create a table with three variables, and plot the 'Th' and 'R1' variables.

% Create a table of random numbers
Th = linspace(0,2*pi,50)';
R1 = randi([0 10],50,1);
R2 = randi([20 30],50,1);
tbl = table(Th,R1,R2);

% Create polar scatter chart
polarscatter(tbl,'Th','R1')

%
% You can also plot multiple variables at the same time. For example, plot two sets of radius values by specifying the rvar argument as the cell array {'R1','R2'}. Then add a legend. The legend labels match the variable names.

polarscatter(tbl,'Th',{'R1','R2'})
legend

% Copyright 2020 The MathWorks, Inc.