# HG changeset patch # User jwe # Date 769113091 0 # Node ID 0ce34c2fc3d541acb6944d5bd258261a225c4d45 # Parent 9a17c682207e85d033b8132febbb8b95ac7dee30 [project @ 1994-05-16 18:30:52 by jwe] diff --git a/scripts/general/linspace.m b/scripts/general/linspace.m --- a/scripts/general/linspace.m +++ b/scripts/general/linspace.m @@ -1,4 +1,4 @@ -# Copyright (C) 1993 John W. Eaton +# Copyright (C) 1993, 1994 John W. Eaton # # This file is part of Octave. # @@ -47,10 +47,7 @@ if (length (x1) == 1 && length (x2) == 1) delta = (x2 - x1) / (npoints - 1); - retval = zeros (1, npoints); - for i = 0:npoints-1 - retval (i+1) = x1 + i * delta; - endfor + retval = x1:delta:x2; else error ("linspace: arguments must be scalars"); endif diff --git a/scripts/general/logspace.m b/scripts/general/logspace.m --- a/scripts/general/logspace.m +++ b/scripts/general/logspace.m @@ -1,4 +1,4 @@ -# Copyright (C) 1993 John W. Eaton +# Copyright (C) 1993, 1994 John W. Eaton # # This file is part of Octave. # @@ -57,10 +57,7 @@ if (x2 == pi) x2_tmp = log10 (pi); endif - retval = linspace (x1, x2_tmp, npoints); - for i = 1:npoints - retval(i) = 10 ^ retval(i); - endfor + retval = 10 .^ (linspace (x1, x2_tmp, npoints)); else error ("logspace: arguments must be scalars"); endif