comparison scripts/control/system/sysappend.m @ 4030:22bd65326ec1

[project @ 2002-08-09 18:58:13 by jwe]
author jwe
date Fri, 09 Aug 2002 19:00:16 +0000
parents b5238ac1dca9
children cef48c4b902d
comparison
equal deleted inserted replaced
4029:2cc57b6169cf 4030:22bd65326ec1
80 sav_empty_list_elements_ok = empty_list_elements_ok; 80 sav_empty_list_elements_ok = empty_list_elements_ok;
81 81
82 empty_list_elements_ok = 1; 82 empty_list_elements_ok = 1;
83 83
84 ## check input arguments 84 ## check input arguments
85 if ( (nargin < 2) | (nargin > 7) | (!is_struct(sys))) 85 if ( (nargin < 2) | (nargin > 7) | (!isstruct(sys)))
86 usage("retsys = sysappend(sys,b,c[,d,outname,inname,yd]) "); 86 usage("retsys = sysappend(sys,b,c[,d,outname,inname,yd]) ");
87 elseif(!is_struct(sys)) 87 elseif(!isstruct(sys))
88 error("sys must be a system data structure"); 88 error("sys must be a system data structure");
89 endif 89 endif
90 90
91 ## default system type must be state space form 91 ## default system type must be state space form
92 [Aa,Ab,Ac,Ad,Ats,Ann,Anz,Ast,Ain,Aout,Ayd] = sys2ss(sys); 92 [Aa,Ab,Ac,Ad,Ats,Ann,Anz,Ast,Ain,Aout,Ayd] = sys2ss(sys);
147 if(Ap) Aout = append(Aout,outname); 147 if(Ap) Aout = append(Aout,outname);
148 else Aout = outname; endif 148 else Aout = outname; endif
149 149
150 ## construct new yd entries 150 ## construct new yd entries
151 if(nargin == 7) 151 if(nargin == 7)
152 if(!is_vector(yd)) 152 if(!isvector(yd))
153 error(sprintf("yd(%dx%d) must be a vector",rows(yd),columns(yd))) 153 error(sprintf("yd(%dx%d) must be a vector",rows(yd),columns(yd)))
154 elseif(rows(c) != length(yd) & rows(d) != length(yd)) 154 elseif(rows(c) != length(yd) & rows(d) != length(yd))
155 error(sprintf("length(yd) = %d; c(%dx%d), d(%dx%d); mismatch", ... 155 error(sprintf("length(yd) = %d; c(%dx%d), d(%dx%d); mismatch", ...
156 length(yd), rows(c), columns(c),rows(d),columns(d))); 156 length(yd), rows(c), columns(c),rows(d),columns(d)));
157 endif 157 endif