Determine whether system is stable
B = isstable(sys)
B = isstable(sys,'elem')
B = isstable(sys) returns a logical value
true) if the dynamic system
sys has stable dynamics, and a logical value
false) otherwise. If
a model array, then
if all models in
sys are stable.
B = isstable(sys,'elem') returns a logical
array of the same dimensions as the model array
The logical array indicates which models in
isstable is only supported for analytical
models with a finite number of poles.
Create an array of SISO transfer function models with poles varying from -2 to 2. To do so, first initialize an array of dimension
[1,length(a)] with zero-valued SISO transfer functions.
a = [-2:2]; sys = tf(zeros(1,1,1,length(a)));
Populate this array with transfer functions of the form
for j = 1:length(a) sys(1,1,1,j) = tf(1,[1 -a(j)]); end sys.SamplingGrid = struct('a',a);
Examine the stability of the model array.
B_all = isstable(sys)
B_all = 0
isstable returns a single Boolean value that is 1 (
true) only if all models in the array are stable.
sys contains some models with nonnegative poles, which are not stable. Therefore,
isstable returns 0 (
false) for the entire array.
Examine stability of each model in the array, element by element.
B_elem = isstable(sys,'elem')
B_elem = 1 1 0 0 0
'elem' flag causes
isstable to return an array of Boolean values, which indicate the stability of the corresponding entry in the model array. For example,
B_elem(2) = 1, which indicates that
sys(1,1,1,2) is stable. This result is expected, because
a = -1.