Skip to Main Content Skip to Search
Product Documentation

set - Set properties of linearization I/Os and operating points

Syntax

set(ob)
set(ob,'PropertyName',val)
ob.PropertyName=val

Description

set(ob) displays all editable properties of the object, ob, which can be a linearization I/O object, an operating point object, or an operating point specification object. Create ob using findop, getlinio, linio, operpoint, or operspec.

set(ob,'PropertyName',val) sets the property, PropertyName, of the object, ob, to the value, val. The object, ob, can be a linearization I/O object, an operating point object, or an operating point specification object. Create ob using findop, getlinio, linio, operpoint, or operspec.

ob.PropertyName=val is an alternative notation for assigning the value, val, to the property, PropertyName, of the object, ob. The object, ob, can be a linearization I/O object, an operating point object, or an operating point specification object. Create ob using findop, getlinio, linio, operpoint, or operspec.

Examples

Create an operating point object for the Simulink model, magball:

op_cond=operpoint('magball');

Use the set function to get a list of all editable properties of this object:

set(op_cond)

This function returns the properties of op_cond.

ans = 
     Model: {}
    States: {}
    Inputs: {}
      Time: {}

To set the value of a particular property of op_cond, provide the property name and the desired value of this property as arguments to set. For example, to change the name of the model associated with the operating point object from 'magball' to 'Magnetic Ball', type:

set(op_cond,'Model','Magnetic Ball')

To view the property value and verify that the change was made, type:

op_cond.Model

which returns

ans =
Magnetic Ball

Because op_cond is a structure, you can set any properties or fields using dot-notation. First, produce a list of properties of the second States object within op_cond, as follows:

set(op_cond.States(2))

which returns

ans = 

                   Nx: {}
                Block: {}
            StateName: {}
                    x: {}
                   Ts: {}
           SampleType: {}
    inReferencedModel: {}
          Description: {}

Now, use dot-notation to set the x property to 8:

op_cond.States(2).x=8;

To view the property and verify that the change was made, type

op_cond.States(2)

which displays

(1.) magball/Magnetic Ball Plant/Current
      x: 8       

See Also

findop | get | linio | operpoint | operspec | setlinio

  


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