Mercurial > hg > octave-lyh
changeset 7311:1b535aed87e2
[project @ 2007-12-12 22:13:43 by jwe]
author | jwe |
---|---|
date | Wed, 12 Dec 2007 22:13:44 +0000 |
parents | dc9b00ab5aac |
children | 1ebbf0924217 |
files | scripts/ChangeLog scripts/linear-algebra/condest.m |
diffstat | 2 files changed, 14 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,7 +1,8 @@ 2007-12-12 John W. Eaton <jwe@octave.org> * linear-algebra/condest.m: Use nargin instead of size(varargin,2). - Allow 6 arguments. Use issquare. + Condense argument processing logic. Allow 6 arguments. + Use issquare. * plot/__go_draw_axes__.m: Handle the axes layer property.
--- a/scripts/linear-algebra/condest.m +++ b/scripts/linear-algebra/condest.m @@ -118,25 +118,18 @@ error ("condest: matrix must be square."); endif - if (nargin > 1) - if (isscalar (varargin{2})) - t = varargin{2}; - else - if (nargin < 3) - error ("condest: must supply both solve and solve_t."); - else - solve = varargin{2}; - solve_t = varargin{3}; - if (nargin > 3) - t = varargin{4}; - endif - endif + if (nargin > 1 && isscalar (varargin{2})) + t = varargin{2}; + elseif (nargin > 2) + solve = varargin{2}; + solve_t = varargin{3}; + if (nargin > 3) + t = varargin{4}; endif + else + error ("condest: must supply both solve and solve_t."); endif - else - if (nargin < 5) - error ("condest: implicit form of condest requires at least 5 arguments."); - endif + elseif (nargin > 4) apply = varargin{1}; apply_t = varargin{2}; solve = varargin{3}; @@ -148,6 +141,8 @@ if (nargin > 5) t = varargin{6}; endif + else + error ("condest: implicit form of condest requires at least 5 arguments."); endif if (! exist ("t", "var"))