MATLAB: How to make a polar plot of the function r=2sin(3t)sin(t) for 0

functionplotpolar

How do I make a polar plot of the function r=2sin(3t)sin(t) for 0<t<2pi?
I'm using this command
t=linspace(o,2*pi,200);
r=2*sin(3t)*sin(t)
polar(t,r)

Best Answer

You’re almost there! You need to vectorise your code (replace (*) with (.*)), substitute ‘0’ for ‘o’ in your linspace call, and insert a ‘*’ multiplication operator:
t=linspace(0,2*pi,200);
r=2*sin(3*t).*sin(t);
polar(t,r)
Related Question