# HG changeset patch # User John W. Eaton # Date 1320652566 18000 # Node ID 2c80bbd87f5d84dcf6367d2fc72d9ea68d47fd21 # Parent 519390f1b67f6abcafa8737b904ef863dc026139 don't define functions in test and demo blocks * scripts/general/profshow.m: Avoid function definition in demo block. * scripts/sparse/bicgstab.m: Avoid function definition in test block. diff --git a/scripts/general/profshow.m b/scripts/general/profshow.m --- a/scripts/general/profshow.m +++ b/scripts/general/profshow.m @@ -90,15 +90,8 @@ %! profshow (T, 10); %!demo -%! function f = myfib (n) -%! if (n <= 2) -%! f = 1; -%! else -%! f = myfib (n - 1) + myfib (n - 2); -%! endif -%! endfunction %! profile ("on"); -%! myfib (20); +%! expm (rand (500) + eye (500)); %! profile ("off"); %! profshow (profile ("info"), 5); diff --git a/scripts/sparse/bicgstab.m b/scripts/sparse/bicgstab.m --- a/scripts/sparse/bicgstab.m +++ b/scripts/sparse/bicgstab.m @@ -217,13 +217,13 @@ %! assert (x, ones (size (b)), 1e-7); %! %!test +%!function y = afun (x, a) +%! y = a * x; +%!endfunction +%! %! tol = 1e-8; %! maxit = 15; %! -%! function y = afun (x, a) -%! y = a * x; -%! endfunction -%! %! [x, flag, relres, iter, resvec] = bicgstab (@(x) afun (x, A), b, %! tol, maxit, M1, M2); %! assert (x, ones (size (b)), 1e-7);