comparison scripts/control/system/ss2sys.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 b8105302cfe8
comparison
equal deleted inserted replaced
4029:2cc57b6169cf 4030:22bd65326ec1
212 endif 212 endif
213 213
214 ## check for continuous states 214 ## check for continuous states
215 if( (nargin < 6) & (tsam == 0) ) n = na; 215 if( (nargin < 6) & (tsam == 0) ) n = na;
216 elseif(nargin < 6) n = 0; 216 elseif(nargin < 6) n = 0;
217 elseif((!is_matrix(n)) | isstr(n)) 217 elseif((!ismatrix(n)) | isstr(n))
218 error("Parameter n is not a numerical value."); 218 error("Parameter n is not a numerical value.");
219 elseif( (!is_scalar(n)) | (n < 0 ) | (n != round(n)) ) 219 elseif( (!isscalar(n)) | (n < 0 ) | (n != round(n)) )
220 if(is_scalar(n)) error("invalid value of n=%d,%e",n,n); 220 if(isscalar(n)) error("invalid value of n=%d,%e",n,n);
221 else error("invalid value of n=(%dx%d)", ... 221 else error("invalid value of n=(%dx%d)", ...
222 rows(n), columns(n)); endif 222 rows(n), columns(n)); endif
223 endif 223 endif
224 224
225 ## check for num discrete states 225 ## check for num discrete states
226 if( (nargin < 7) & (tsam == 0)) nz = 0; 226 if( (nargin < 7) & (tsam == 0)) nz = 0;
227 elseif(nargin < 7) nz = na - n; 227 elseif(nargin < 7) nz = na - n;
228 elseif((!is_matrix(nz)) | isstr(nz)) 228 elseif((!ismatrix(nz)) | isstr(nz))
229 error("Parameter nz is not a numerical value."); 229 error("Parameter nz is not a numerical value.");
230 elseif( (!is_scalar(nz)) | (nz < 0 ) | (nz != round(nz)) ) 230 elseif( (!isscalar(nz)) | (nz < 0 ) | (nz != round(nz)) )
231 if(is_scalar(nz)) 231 if(isscalar(nz))
232 error(["invalid value of nz=",num2str(nz)]); 232 error(["invalid value of nz=",num2str(nz)]);
233 else 233 else
234 error(["invalid value of nz=(",num2str(rows(nz)),"x", ... 234 error(["invalid value of nz=(",num2str(rows(nz)),"x", ...
235 num2str(columns(nz)),")"]); 235 num2str(columns(nz)),")"]);
236 endif 236 endif