On entry, | . |
Open in the MATLAB editor: c06gc_example
function c06gc_example fprintf('c06gc example results\n\n'); x_r = [ 0.34907; 0.54890; 0.74776; 0.94459; 1.13850; 1.32850; 1.51370]; x_i = [-0.37168; -0.35669; -0.31175; -0.23702; -0.13274; 0.00074; 0.16298]; z = x_r + i*x_i; disp('Complex data:'); disp(z); [x_r, x_i, ifail] = c06ec(x_r, x_i); z = x_r + i*x_i; disp('Complex Fourier coeffients:'); disp(z); [x_i, ifail] = c06gc(x_i); [x_r, x_i, ifail] = c06ec(x_r, x_i); [x_i, ifail] = c06gc(x_i); z = x_r + i*x_i; disp('Retrieved complex data:'); disp(z);
c06gc example results Complex data: 0.3491 - 0.3717i 0.5489 - 0.3567i 0.7478 - 0.3118i 0.9446 - 0.2370i 1.1385 - 0.1327i 1.3285 + 0.0007i 1.5137 + 0.1630i Complex Fourier coeffients: 2.4836 - 0.4710i -0.5518 + 0.4968i -0.3671 + 0.0976i -0.2877 - 0.0586i -0.2251 - 0.1748i -0.1483 - 0.3084i 0.0198 - 0.5650i Retrieved complex data: 0.3491 - 0.3717i 0.5489 - 0.3567i 0.7478 - 0.3117i 0.9446 - 0.2370i 1.1385 - 0.1327i 1.3285 + 0.0007i 1.5137 + 0.1630i