Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

get

Access model property values

Syntax

Value = get(sys,'PropertyName')
Struct = get(sys)

Description

Value = get(sys,'PropertyName') returns the current value of the property PropertyName of the model object sys. 'PropertyName' can be the full property name (for example, 'UserData') or any unambiguous case-insensitive abbreviation (for example, 'user'). See reference pages for the individual model object types for a list of properties available for that model.

Struct = get(sys) converts the TF, SS, or ZPK object sys into a standard MATLAB® structure with the property names as field names and the property values as field values.

Without left-side argument,

get(sys)

displays all properties of sys and their values.

Examples

Consider the discrete-time SISO transfer function defined by

h = tf(1,[1 2],0.1,'inputname','voltage','user','hello')

You can display all properties of h with

get(h)
           Numerator: {[0 1]}
     Denominator: {[1 2]}
        Variable: 'z'
         IODelay: 0
      InputDelay: 0
     OutputDelay: 0
              Ts: 0.1000
        TimeUnit: 'seconds'
       InputName: {'voltage'}
       InputUnit: {''}
      InputGroup: [1x1 struct]
      OutputName: {''}
      OutputUnit: {''}
     OutputGroup: [1x1 struct]
            Name: ''
           Notes: {}
        UserData: 'hello'
    SamplingGrid: [1x1 struct]

or query only about the numerator and sample time values by

get(h,'Numerator')

ans = 
    [1x2 double]

and

get(h,'Ts')

ans =
    0.1000

Because the numerator data (NUmerator property) is always stored as a cell array, the first command evaluates to a cell array containing the row vector [0 1].

More About

collapse all

Tips

An alternative to the syntax

Value = get(sys,'PropertyName')

is the structure-like referencing

Value = sys.PropertyName

For example,

sys.Ts
sys.A
sys.user

return the values of the sample time, A matrix, and UserData property of the (state-space) model sys.

Introduced before R2006a

Was this topic helpful?