changeset 2015:9e4e71b27b3a

[project @ 1996-03-20 11:10:42 by jwe]
author jwe
date Wed, 20 Mar 1996 11:12:35 +0000
parents b3fd115759b7
children 6f3428b0d2c7
files scripts/general/tril.m scripts/general/triu.m
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/general/tril.m
+++ b/scripts/general/tril.m
@@ -40,7 +40,7 @@
     usage ("tril (x [, k])");
   endif
 
-  for j = 1 : min (nc, nc + abs (k))
+  for j = 1 : min (nc, nr+k)
     nr_limit = max (1, j-k);
     retval (nr_limit:nr, j) = x (nr_limit:nr, j);
   endfor
--- a/scripts/general/triu.m
+++ b/scripts/general/triu.m
@@ -40,7 +40,7 @@
     usage ("triu (x [, k])");
   endif
 
-  for j = max (1, k) : nc
+  for j = max (1, k+1) : nc
     nr_limit = min (nr, j-k);
     retval (1:nr_limit, j) = x (1:nr_limit, j);
   endfor