Guest User

Untitled

a guest
Jul 10th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.75 KB | None | 0 0
  1. t = -2:2;
  2.  
  3. color = ['r', 'g', 'b', 'k', 'c' ];
  4.  
  5. for N = 1:5
  6.    
  7.     x = t.^2;
  8.     y = t.^3;
  9.     [th,r]=cart2pol(x,y);
  10.    
  11.     switch N
  12.         case 1
  13.             subplot(3,2,N)
  14.             polar(th, r, color(N))
  15.             hold on
  16.         case 2
  17.             subplot(3,2,N)
  18.             polar(th, r, color(N))
  19.             hold on
  20.         case 3
  21.             subplot(3,2,N)
  22.             polar(th, r, color(N))
  23.             hold on
  24.         case 4
  25.             subplot(3,2,N)
  26.             polar(th, r, color(N))
  27.             hold on
  28.         case 5
  29.             subplot(3,2,N)
  30.             polar(th, r, color(N))
  31.            
  32.            
  33.             hold on
  34.         otherwise
  35.             disp('error')
  36.     end
  37.  
  38.     t = t + 1;
  39.    
  40. end
Add Comment
Please, Sign In to add comment