Mercurial > hg > octave-terminal
changeset 4404:c05051baf03b
[project @ 2003-05-01 19:41:57 by jwe]
author | jwe |
---|---|
date | Thu, 01 May 2003 19:42:10 +0000 |
parents | f52b3f1a9399 |
children | a4c9986e5ae5 |
files | scripts/ChangeLog scripts/control/system/sysadd.m |
diffstat | 2 files changed, 21 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2003-05-01 John W. Eaton <jwe@bevo.che.wisc.edu> + + * control/system/sysadd.m: If systems are not "tf", convert before + adding. + 2003-05-01 Paul Kienzle <pkienzle@users.sf.net> * image/imagesc.m: Accept data limits parameter for colormap.
--- a/scripts/control/system/sysadd.m +++ b/scripts/control/system/sysadd.m @@ -73,19 +73,25 @@ endfor ## perform the add - if(nargin == 2) - Gsys = nth(arglist,1); Hsys = nth(arglist,2); - if( strcmp(sysgettype(Gsys),"tf") | strcmp(sysgettype(Hsys),"tf") ) - ## see if adding transfer functions with identical denominators + if (nargin == 2) + Gsys = nth(arglist,1); + Hsys = nth(arglist,2); + + if (! strcmp (sysgettype (Gsys), "tf")) [Gnum,Gden,GT,Gin,Gout] = sys2tf(Gsys); + endif + + if (! strcmp (sysgettype (Hsys),"tf")) [Hnum,Hden,HT,Hin,Hout] = sys2tf(Hsys); - if(length(Hden) == length(Gden) ) - if( (Hden == Gden) & (HT == GT) ) - sys = tf2sys(Gnum+Hnum,Gden,GT,Gin,Gout); - return - endif - ## if not, we go on and do the usual thing... + endif + + ## see if adding transfer functions with identical denominators + if (length(Hden) == length(Gden) ) + if( (Hden == Gden) & (HT == GT) ) + sys = tf2sys(Gnum+Hnum,Gden,GT,Gin,Gout); + return endif + ## if not, we go on and do the usual thing... endif ## make sure in ss form