Skip to Main Content Skip to Search
Product Documentation

set - Set properties with specified values

Syntax

thisObject.set(propName,value,...)

Description

The set method sets the value of a specified property or sets the values of a set of specified properties for this object. You specify properties and values through pairs of property (name, value) arguments.

The get method is also vectorized so that it sets an m-by-n cell array of values for an array of m objects and an array of n properties.

Arguments

thisObject

The object for which the specified property is set. Can be any Stateflow object.

propName

String name of the property to set (e.g., 'FontSize'). Can also be a cell array of m property names.

value

New value for the specified property. Can be a cell array of m-by-n values if thisObject is an array of m objects and propName is an array of n property names.

Returns

None

Examples

The following command sets the Name and Description properties of the State object s:

s.set('Name', 'Kentucky', 'Description', 'Bluegrass State')

The following command sets the Position property of the State object s:

s.set('Position',[200,119,90,60])
  


Free Stateflow Interactive Kit

Learn how engineers use Stateflow to model state machines in their Simulink models.


Get free kit

Trials Available

Try the latest version of Stateflow.


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