Determine if model has real-valued coefficients



B = isreal(sys) returns a logical value of 1 (true) if the model sys has real-valued coefficients, and a logical value of 0 (false) otherwise. If sys is a model array, then B = 1 if all models in sys have real-valued coefficients.


B = isreal(sys,'elem') checks each model in the model array sys and returns a logical array of the same size as sys. The logical array indicates which models in sys have real coefficients.


collapse all

Create a model and check whether its coefficients are all real-valued.

sys = rss(3);
B = isreal(sys)
B = logical

The model, sys, has real-valued coefficients.

Create a 1-by-5 array of models, and check each model for real-valued coefficients.

sys = rss(2,2,2,1,5);
B = isreal(sys,'elem')
B = 1x5 logical array

   1   1   1   1   1

isreal checks each model in the model array, sys, and returns a logical array indicating which models have all real-valued coefficients.

Input Arguments

collapse all

Model or array to check, specified as an input-output model or model array. Input-output models include dynamic system models such as numeric LTI models and generalized models. Input-output models also include static models such as tunable parameters or generalized matrices.

Output Arguments

collapse all

Flag indicating whether model has real-valued coefficients, returned as a logical value or logical array.

See Also

Introduced in R2013a