Cases prefixed with W are classified as warnings and do not generate an error of type NAG:error_n. See nag_issue_warnings.
Open in the MATLAB editor: s18cs_example
function s18cs_example fprintf('s18cs example results\n\n'); x = [0; 0.5; 1; 3; 6; 10; 1000; -1]; [f, ifail] = s18cs(x); fprintf(' x e^-|x| I_0(x)\n'); for i=1:numel(x) fprintf('%12.3e%12.3e\n', x(i), f(i)); end
s18cs example results x e^-|x| I_0(x) 0.000e+00 1.000e+00 5.000e-01 6.450e-01 1.000e+00 4.658e-01 3.000e+00 2.430e-01 6.000e+00 1.667e-01 1.000e+01 1.278e-01 1.000e+03 1.262e-02 -1.000e+00 4.658e-01