1 // =============================================================================
2 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 // Copyright (C) 2008-2008 - INRIA - Jean-Baptiste Silvy
5 // This file is distributed under the same license as the Scilab package.
6 // =============================================================================
7 // <-- TEST WITH GRAPHIC -->
8 // <-- Non-regression test for bug 120 -->
10 // <-- Bugzilla URL -->
11 // http://bugzilla.scilab.org/show_bug.cgi?id=120
13 // <-- Short Description -->
14 // It seems that function bode doesn't work properly.
15 // It shift x (horizontal) axis for one decade in right. So the bode plot is incorect.
16 // create a linerar system
21 h=syslin("c",(s^2+2*0.9*10*s+100)/(s^2+2*0.3*10.1*s+102.01))
29 my_title="(s^2+2*0.9*10*s+100)/(s^2+2*0.3*10.1*s+102.01)";
30 // draw the bode plot between fmin and fmax
33 bode(h,fmin,fmax,my_title);
34 // check that the axes data bounds are fmin and fmax
36 // get data bounds of phase plot
37 dataBounds1 = curFig.children(1).data_bounds
42 // check that the X bounds are [fmin, fmax]
43 if (dataBounds1(1,1) <> fmin) then bugmes();quit;end;
44 if (dataBounds1(2,1) <> fmax) then bugmes();quit;end;
45 // same for magnitude plot
46 dataBounds2 = curFig.children(2).data_bounds
51 // check that the X bounds are [fmin, fmax]
52 if (dataBounds2(1,1) <> fmin) then bugmes();quit;end;
53 if (dataBounds2(2,1) <> fmax) then bugmes();quit;end;