title: Plotting complex function in MATLAB (polar)?
body: <p>I have tried to plot this function:</p>
  
  <pre><code>t=linspace(0,2*pi,100);
  a=input('a= ');
  b=input('b= ');
  c=input('c= ');
  k = a*(1-(sin(3*t)).^(2*b))+c;
  polar(t,k)
  
  % a=2.6
  % b=0.4
  % c=5
  </code></pre>
  
  <p>Each time, I get the following message: </p>
  
  <blockquote>
    <p>Warning: Imaginary parts of complex X and/or Y arguments ignored.</p>
  </blockquote>
  
  <p>I have tried the pol2cart method as such:</p>
  
  <pre><code>t=linspace(0,2*pi,100);
  a=input('a= ');
  b=input('b= ');
  c=input('c= ');
  k = a*(1-(sin(3*t)).^(2*b))+c;
  [x,y] = pol2cart(t,k);
  plot(x,y)
  </code></pre>
  
  <p>I got the same message again.
  I have tried to convert it to spherical coordinates, it didn't work. I have also tried the arrayfun method as suggested in a forum answer, it didn't work as well.
  Can someone please help me?
  Thank you!</p>