Main Content

isempty

Determine whether dynamic system model is empty

Syntax

isempty(sys)

Description

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.

Examples

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.

isempty(sys1)
ans = logical
   1

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

Similarly, isempty returns 1 for an empty transfer function.

isempty(tf)
ans = logical
   1

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.

isempty(sys2)
ans = logical
   0

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

See Also

|

Introduced before R2006a