changeset 13837:2c80bbd87f5d

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.
author John W. Eaton <jwe@octave.org>
date Mon, 07 Nov 2011 02:56:06 -0500
parents 519390f1b67f
children a35d381e22b0
files scripts/general/profshow.m scripts/sparse/bicgstab.m
diffstat 2 files changed, 5 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/general/profshow.m	Sun Nov 06 21:22:49 2011 -0800
+++ b/scripts/general/profshow.m	Mon Nov 07 02:56:06 2011 -0500
@@ -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);
 
--- a/scripts/sparse/bicgstab.m	Sun Nov 06 21:22:49 2011 -0800
+++ b/scripts/sparse/bicgstab.m	Mon Nov 07 02:56:06 2011 -0500
@@ -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);