set

Set or modify LTI 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 an LTI model (see LTI Properties for background on LTI properties). 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 LTI 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 (see Model-Specific Properties for details).

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'. See Property Values below for an overview of legitimate LTI property values.

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

Example

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 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 

Property Values

The following table lists the admissible values for each LTI property. and denotes the number of inputs and outputs of the underlying LTI model. For K-dimensional LTI arrays, let denote the array dimensions.

LTI Properties

Property Name

Admissible Property Values

Ts
  • 0 (zero) for continuous-time systems

  • Sample time in seconds for discrete-time systems

  • -1 or [] for discrete systems with unspecified sample time

    Note: Resetting the sample time property does not alter the model data. Use c2d, d2c, or d2d for discrete/continuous and discrete/discrete conversions.

InputDelay

Input delays specified with

  • Nonnegative real numbers for continuous-time models (seconds)

  • Integers for discrete-time models (number of sample periods)

  • Scalar when or system has uniform input delay

  • Vector of length to specify independent delay times for each input channel

  • Array of size -by- -by- -by-. . .-by- to specify different input delays for each model in an LTI array.

OutputDelay

delays specified withOutput

  • Nonnegative real numbers for continuous-time models (seconds)

  • Integers for discrete-time models (number of sample periods)

  • Scalar when or system has uniform output delay

  • Vector of length to specify independent delay times for each output channel

  • Array of size -by- -by- -by-. . .-by- to specify different output delays for each model in an LTI array.

InputName
  • String for single-input systems, for example, 'thrust'

  • Cell vector of strings for multi-input systems (with as many cells as inputs), for example, {'u';'w'} for a two-input system

  • Padded array of strings with as many rows as inputs, for example,

    ['rudder ' ; 'aileron']
    

OutputDelay

Same as InputDelay

Notes

String, array of strings, or cell array of strings

UserData

Arbitrary MATLAB® variable

State-Space Model Properties

Property Name

Admissible Property Values

StateName

Same as InputName (with Input replaced by State)

a, b, c, d, e

Real- or complex-valued state-space matrices (multidimensional arrays, in the case of LTI arrays) with compatible dimensions for the number of states, inputs, and outputs. See The Size of LTI Array Data for SS Models.

InternalDelay

This property contains internal representations of delays in state-space. Internal delays in SS objects are creating when converting from ZPK or TF objects with I/O delays. We do not recommmend using set to modify this property. See Time Delays for more information.

TF Model Properties

Property Name

Admissible Property Values

num, den
  • Real- or complex-valued row vectors for the coefficients of the numerator or denominator polynomials in the SISO case. List the coefficients in descending powers of the variable or by default, and in ascending powers of when the Variable property is set to 'q' or 'z^-1' (see note below).

  • -by- cell arrays of real- or complex-valued row vectors in the MIMO case, for example,
    {[1 2];[1 0 3]} for a two-output/one-input transfer function

  • -by- -by- -by- -by- -dimensional real- or complex-valued cell arrays for MIMO LTI arrays

Variable
  • String 's' (default) or 'p' for continuous-time systems

  • String 'z' (default), 'q', or 'z^-1' for discrete-time systems

ioDelay
  • An matrix of dimension -by- , where Ny is the number of outputs and Nu is the number of inputs.

  • If you have an LTI array, using an -by- matrix populates all the LTI models in the LTI array with the specified ioDelay matrix. To specify I/O delays for individual models in the LTI array, use an -by- -by- -by- -by- - array, where S1, ..., SK are the dimensions of the LTI array.

ZPK Model Properties

Property Name

Admissible Property Values

z, p

  • Vectors of zeros and poles (either real- or complex-valued) in SISO case

  • -by- cell arrays of vectors (entries are real- or complex valued) in MIMO case, for example, z = {[],[-1 0]} for a model with two inputs and one output

  • -by- -by- -by- -by- -dimensional cell arrays for MIMO LTI arrays

ioDelay
  • A matrix of dimension -by- , where Ny is the number of outputs and Nu is the number of inputs.

  • If you have an LTI array, using an -by- matrix populates all the LTI models in the LTI array with the specified ioDelay matrix. To specify I/O delays for individual models in the LTI array, use an -by- -by- -by- -by- - array, where S1, ..., SK are the dimensions of the LTI array.

Variable
  • String 's' (default) or 'p' for continuous-time systems

  • String 'z' (default), 'q', or 'z^-1' for discrete-time systems

FRD Model Properties

Property Name

Admissible Property Values

Frequency

Real-valued vector of length -by-1, where is the number of frequencies

Response
  • -by- -by- -dimensional array of complex data for single LTI models

  • -by- -by- -by- -by- -by- -dimensional array for LTI arrays

Units

String 'rad/s' (default), or 'Hz'

ioDelay
  • An matrix of dimension -by- , where Ny is the number of outputs and Nu is the number of inputs.

  • If you have an LTI array, using an -by- matrix populates all the LTI models in the LTI array with the specified ioDelay matrix. To specify I/O delays for individual models in the LTI array, use an -by- -by- -by- -by- - array, where S1, ..., SK are the dimensions of the LTI array.

Remark

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' (or 'q') 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 and and produces:

See Also

get, frd, ss, tf, zpk

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS