Search code examples
matlabpolar-coordinates

display values in polar plot (matlab)


I am a newbie in MATLAB and I have to display values in polar plot. My values are like this

values1 = [1.424; 1.425; 1.411; 1.555; 1.023; 1.534]; % 100 values...
values2 = [120.323; 112.414; 114.412; 120.333; 120.665; 121.888]; % 100 values...

I figured out how to draw a plain circle but I don't know how to affect the line with those values (and draw the other one).

t = 0 : 2*pi/100 : 2*pi; 
r = (power(sin(t),2) + power(cos(t),2));
polar(t,r)

I am expecting something like this (just found image for illustration). How can I do it? Thank you. enter image description here


Solution

  • Are you looking for something like this:

    values1 = normrnd(100,10,1,101); % 101 values...
    values2 = normrnd(100,10,1,101); % 101 values...
    t = 0 : 2*pi/100 : 2*pi; 
    
    figure,
    polar(t,values1)
    hold on
    polar(t,values2)
    hold off
    

    For more information about the hold command check the Matlab help.