3bdfe9a00f909e71c3653deb99b3ce4c9821c82f
[scilab.git] / scilab / modules / statistics / tests / unit_tests / cdft.dia.ref
1 // =============================================================================
2 // Tests for cdft() function
3 //
4 // Scilab Team
5 // Copyright INRIA
6 //
7 // using a table
8 //
9 // =============================================================================
10 prec    = 1.e-5;
11 Tab     = [0.9,0.5,0.3,0.20,0.10,0.05,0.02];
12 Df      = [1,2,3,4,5,6,7];
13 Th      = [0.158,0.816,1.250,1.533,2.015,2.447,2.998];
14 [P1,Q1] = cdft("PQ",Th,Df);
15 [P2,Q2] = cdft("PQ",-Th,Df);
16 if norm(Tab-(Q1+P2)) > 0.1 then pause, end
17 [P,Q] = cdft("PQ",Th,Df);
18 Th1   = cdft("T",Df,P,Q);
19 Df1   = cdft("Df",P,Q,Th);
20 if norm(Th1-Th) > prec then bugmes();quit;end
21 if norm(Df1-Df) > prec then bugmes();quit;end