Mercurial > hg > octave-nkf
diff scripts/general/logspace.m @ 11469:c776f063fefe
Overhaul m-script files to use common variable name between code and documentation.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sun, 09 Jan 2011 12:41:21 -0800 |
parents | a8ce6bdecce5 |
children | fd0a3ac60b0e |
line wrap: on
line diff
--- a/scripts/general/logspace.m +++ b/scripts/general/logspace.m @@ -61,7 +61,7 @@ ## Author: jwe -function retval = logspace (x1, x2, n) +function retval = logspace (base, limit, n) if (nargin == 2) npoints = 50; @@ -75,12 +75,11 @@ print_usage (); endif - if (length (x1) == 1 && length (x2) == 1) - x2_tmp = x2; - if (x2 == pi) - x2_tmp = log10 (pi); + if (length (base) == 1 && length (limit) == 1) + if (limit == pi) + limit = log10 (pi); endif - retval = 10 .^ (linspace (x1, x2_tmp, npoints)); + retval = 10 .^ (linspace (base, limit, npoints)); else error ("logspace: arguments must be scalars"); endif