# HG changeset patch # User jwe # Date 931837776 0 # Node ID ae3bdfd82f918131c042be10e80ee828f3315d96 # Parent 60866c521b9293806c06bbe3bad3d88b672702cb [project @ 1999-07-13 03:49:22 by jwe] diff --git a/doc/interpreter/basics.texi b/doc/interpreter/basics.texi --- a/doc/interpreter/basics.texi +++ b/doc/interpreter/basics.texi @@ -889,7 +889,7 @@ @end deffn @defvr {Built-in Variable} echo_executing_commands -This variable is may also be used to control the echo state. It may be +This variable may also be used to control the echo state. It may be the sum of the following values: @table @asis @@ -940,7 +940,7 @@ case, Octave generated an error message because the keyword @code{function} was misspelled. Instead of seeing @samp{function f}, Octave saw two consecutive variable names, which is invalid in this -context. It marked the error at the @code{y} because the first name by +context. It marked the error at @code{y} because the first name by itself was accepted as valid input. Another class of error message occurs at evaluation time. These @@ -973,9 +973,10 @@ In the example above, the first line indicates that a variable named @samp{x} was found to be undefined near line 1 and column 24 of some function or expression. For errors occurring within functions, lines -from the beginning of the file containing the function definition. For -errors occurring at the top level, the line number indicates the input -line number, which is usually displayed in the prompt string. +are counted from the beginning of the file containing the function +definition. For errors occurring at the top level, the line number +indicates the input line number, which is usually displayed in the +prompt string. The second and third lines in the example indicate that the error occurred within an assignment expression, and the last line of the error diff --git a/doc/interpreter/diffeq.texi b/doc/interpreter/diffeq.texi --- a/doc/interpreter/diffeq.texi +++ b/doc/interpreter/diffeq.texi @@ -20,7 +20,7 @@ @node Ordinary Differential Equations, Differential-Algebraic Equations, Differential Equations, Differential Equations @section Ordinary Differential Equations -The function @code{lsode} can be used Solve ODEs of the form +The function @code{lsode} can be used to solve ODEs of the form @iftex @tex $$ @@ -122,7 +122,7 @@ @node Differential-Algebraic Equations, , Ordinary Differential Equations, Differential Equations @section Differential-Algebraic Equations -The function @code{dassl} can be used Solve DAEs of the form +The function @code{dassl} can be used to solve DAEs of the form @iftex @tex $$ diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,19 @@ +Mon Jul 12 22:48:34 1999 John W. Eaton + + * linear-algebra/cond.m: Avoid returning NaN for matrices that + contain only zeros. + +Sun Jun 20 22:24:27 1999 Eduardo Gallestey + + * linear-algebra/kron.m: Create result matrix and insert blocks + instead of appending them. + +Sat Jun 19 01:52:18 1999 John W. Eaton + + * control/bodquist.m, control/buildssic.m, control/is_digital.m, + control/stepimp.m, control/sysmin.m, control/syssetsignals.m: + Update from A. S. Hodel. + Fri Jun 18 12:19:22 1999 John W. Eaton * polynomial/polyfit.m: Correct previous change. diff --git a/scripts/linear-algebra/cond.m b/scripts/linear-algebra/cond.m --- a/scripts/linear-algebra/cond.m +++ b/scripts/linear-algebra/cond.m @@ -39,8 +39,18 @@ endif retval = 0.0; endif - sigma = svd (a); - retval = sigma (1) / sigma (length (sigma)); + if (any (any (isinf (a) | isnan (a)))) + error ("cond: argument must not contain Inf or NaN values"); + else + sigma = svd (a); + sigma_1 = sigma(1); + sigma_n = sigma(length (sigma)); + if (sigma_1 == 0 || sigma_n == 0) + retval = Inf; + else + retval = sigma_1 / sigma_n; + endif + endif else usage ("cond (a)"); endif diff --git a/scripts/linear-algebra/kron.m b/scripts/linear-algebra/kron.m --- a/scripts/linear-algebra/kron.m +++ b/scripts/linear-algebra/kron.m @@ -35,25 +35,17 @@ [m, n] = size (b); [ma, na] = size (a); - ## Do 1st column. - - x = a (1, 1) * b; - for ii = 2:ma - tmp = a (ii, 1) * b; - x = [x; tmp]; - endfor - - ## Do remaining columns. + x = zeros (ma*m, na*n); + i_vec = 1:m; + j_vec = 1:n; - for jj = 2:na - tmp = a (1, jj) * b; - for ii = 2:ma - pmt = a (ii, jj) * b; - tmp = [tmp; pmt]; + for jj = 1:na + for ii = 1:ma + x(i_vec+(ii-1)*m,j_vec) = a(ii,jj) * b; endfor - x = [x, tmp]; + j_vec = jvec + n; endfor - + else usage ("kron (a, b)"); endif