This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Determine whether dynamic system model is empty




isempty(sys) returns a logical value of 1 (true) if the dynamic system model sys has no input or no output, and a logical value of 0 (false) otherwise. Where sys is a frd model, isempty(sys) returns 1 when the frequency vector is empty. Where sys is a model array, isempty(sys) returns 1 when the array has empty dimensions or when the LTI models in the array are empty.


collapse all

Create a continuous-time state-space model with 1 input and no outputs. In this example, specify the A and B matrices as 1 and 2, respectively.

sys1 = ss(1,2,[],[]);

Determine whether sys1 is empty.

ans = logical

The isempty command returns 1 because the system does not have any outputs.

Similarly, isempty returns 1 for an empty transfer function.

ans = logical

Now create a state-space model with 1 input and 1 output. In this example, specify the A, B, C, and D matrices as 1, 2, 3, and 4, respectively.

sys2 = ss(1,2,3,4);

Determine whether sys2 is empty.

ans = logical

The command returns 0 because the system has inputs and outputs.

See Also


Introduced before R2006a