changeset 556:b805b12f3b66

[project @ 1994-07-25 18:22:43 by jwe]
author jwe
date Mon, 25 Jul 1994 18:22:43 +0000
parents 50cf0f8ebde1
children e6ae50d8d4eb
files scripts/special-matrix/hilb.m
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/special-matrix/hilb.m	Sat Jul 23 04:00:50 1994 +0000
+++ b/scripts/special-matrix/hilb.m	Mon Jul 25 18:22:43 1994 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 1993 John W. Eaton
+# Copyright (C) 1993, 1994 John W. Eaton
 # 
 # This file is part of Octave.
 # 
@@ -35,10 +35,9 @@
   nmax = length (n);
   if (nmax == 1)
     retval = zeros (n);
-    for j = 1:n
-      for i = 1:n
-        retval (i, j) = 1 / (i + j - 1);
-      endfor
+    tmp = 1:n;
+    for i = 1:n
+      retval (i, :) = 1.0 ./ (tmp + (i - 1));
     endfor
   else
     error ("hilb: expecting scalar argument, found something else");