diff scripts/general/linspace.m @ 415:0ce34c2fc3d5

[project @ 1994-05-16 18:30:52 by jwe]
author jwe
date Mon, 16 May 1994 18:31:31 +0000
parents 16a24e76d6e0
children f8c8c2461f4d
line wrap: on
line diff
--- 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