Page 65 - MATLAB an introduction with applications
P. 65

50 ———  MATLAB: An Introduction with Applications

                   Solution:
                       (a)  t = linspace(0,2*pi,200);
                            r = sqrt(abs(5*cos(3*t)));
                                 polar(t,r)
                                                               90  2.5
                                                      120             60
                                                                 2
                                                                 1.5
                                                150
                                                                 1          30
                                                                0.5
                                              180                             0




                                                210                         330

                                                      240             300
                                                              270
                                                         Fig. E1.10(a)


                       (b)  t=linspace(0, 2*pi, 200);
                            r=sqrt(abs(5*cos(3*t)));
                            x=r*cos(t);
                            y=r*sin(t);
                            fill(x, y, ‘k’),
                            axis(‘square’)

                                              2

                                             1.5
                                              1
                                             0.5

                                              0

                                            –0.5
                                             –1
                                            –1.5

                                             –2
                                               –3   –2   –1    0     1    2    3
                                                         Fig. E1.10(b)










                   F:\Final Book\Sanjay\IIIrd Printout\Dt. 10-03-09
   60   61   62   63   64   65   66   67   68   69   70