Page 178 - MATLAB an introduction with applications
P. 178

Control Systems ———  163


                       >> title(‘Unit-step response’)
                       >> xlabel(‘t Sec’)
                       >> ylabel(‘Output y(t)’)








                                                       Unit-step response
                                     1.6

                                     1.4

                                     1.2

                                    y(t)  1
                                    Output  0.8


                                     0.6

                                     0.4

                                     0.2

                                      0
                                       0           5           10         15          20
                                                             t Sec
                                                 Fig. E3.16 Unit-step response



                       >> %Response to rise from 10% to 90% of its final value
                       >> r1=1;while y(r1)<0.1,r1= r1+1;end
                       >> r2=1;while y(r2)<0.9,r2= r2+1;end
                       >> rise_time=(r2–r1)*0.02


                       rise_time =
                                0.5400
                   >> [ymax,tp]=max(y);
                   >> peak_time=(tp–1)*0.02












                   F:\Final Book\Sanjay\IIIrd Printout\Dt. 10-03-09
   173   174   175   176   177   178   179   180   181   182   183