comparison scripts/control/base/place.m @ 7126:4a375de63f66

[project @ 2007-11-08 03:44:14 by jwe]
author jwe
date Thu, 08 Nov 2007 03:44:15 +0000
parents f084ba47812b
children
comparison
equal deleted inserted replaced
7125:f084ba47812b 7126:4a375de63f66
49 print_usage (); 49 print_usage ();
50 endif 50 endif
51 51
52 ## check arguments 52 ## check arguments
53 53
54 if(! isstruct (sys)) 54 if (! isstruct (sys))
55 error ("sys must be in system data structure format (see ss)"); 55 error ("sys must be in system data structure format (see ss)");
56 endif 56 endif
57 sys = sysupdate (sys, "ss"); # make sure it has state space form up to date 57 sys = sysupdate (sys, "ss"); # make sure it has state space form up to date
58 if (! is_controllable (sys)) 58 if (! is_controllable (sys))
59 error ("sys is not controllable"); 59 error ("sys is not controllable");
64 endif 64 endif
65 ## system must be purely continuous or discrete 65 ## system must be purely continuous or discrete
66 is_digital (sys); 66 is_digital (sys);
67 [n, nz, m, p] = sysdimensions (sys); 67 [n, nz, m, p] = sysdimensions (sys);
68 nx = n+nz; # already checked that it's not a mixed system. 68 nx = n+nz; # already checked that it's not a mixed system.
69 if(m != 1) 69 if (m != 1)
70 error ("sys has %d inputs; need only 1", m); 70 error ("sys has %d inputs; need only 1", m);
71 endif 71 endif
72 72
73 ## takes the A and B matrix from the system representation 73 ## takes the A and B matrix from the system representation
74 [A, B] = sys2ss (sys); 74 [A, B] = sys2ss (sys);