Skip to Main Content Skip to Search
Product Documentation

set - Set or modify model properties

Syntax

set
set(sys,'Property',Value)
set(sys,'Property1',Value1,'Property2',Value2,...)
set(sys,'Property')
set(sys)

Description

set is used to set or modify the properties of a dynamic system model. Like its Handle Graphics® counterpart, set uses property name/property value pairs to update property values.

set(sys,'Property',Value) assigns the value Value to the property of the model sys specified by the string 'Property'. This string can be the full property name (for example, 'UserData') or any unambiguous case-insensitive abbreviation (for example, 'user'). The specified property must be compatible with the model type. For example, if sys is a transfer function, Variable is a valid property but StateName is not. For a complete list of available system properties for any linear model type, see the reference page for that model type.

set(sys,'Property1',Value1,'Property2',Value2,...) sets multiple property values with a single statement. Each property name/property value pair updates one particular property.

set(sys,'Property') displays admissible values for the property specified by 'Property'.

set(sys) displays all assignable properties of sys and their admissible values.

Examples

Consider the SISO state-space model created by

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

You can add an input delay of 0.1 second, label the input as torque, reset the D matrix to zero, and store its DC gain in the 'Userdata' property by

set(sys,'inputd',0.1,'inputn','torque','d',0,'user',dcgain(sys))

Note that set does not require any output argument. Check the result with get by typing

get(sys)
               a: 1           
               b: 2           
               c: 3           
               d: 0           
               e: []          
       StateName: {''}        
   InternalDelay: [0x1 double]
              Ts: 0           
      InputDelay: 0.1         
     OutputDelay: 0           
       InputName: {'torque'}  
      OutputName: {''}        
      InputGroup: [1x1 struct]
     OutputGroup: [1x1 struct]
            Name: ''          
           Notes: {}          
        UserData: -2 

Tips

For discrete-time transfer functions, the convention used to represent the numerator and denominator depends on the choice of variable (see tf for details). Like tf, the syntax for set changes to remain consistent with the choice of variable. For example, if the Variable property is set to 'z' (the default),

set(h,'num',[1 2],'den',[1 3 4])

produces the transfer function

However, if you change the Variable to 'z^-1' by

set(h,'Variable','z^-1'),

the same command

set(h,'num',[1 2],'den',[1 3 4])

now interprets the row vectors [1 2] and [1 3 4] as the polynomials 1 + 2z−1 and 1 + 3z−1 + 4z−2 and produces:

See Also

frd | get | ss | tf | zpk

Tutorials

How To

  


Free Control Systems Interactive Kit

Learn more about resources for designing, testing, and implementing control systems.

Get free kit

Trials Available

Try the latest control systems products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS