set - Configure or display object properties

Syntax

set(obj)
props = set(obj)
set(obj,'PropertyName')
props = set(obj,'PropertyName')
set(obj,'PropertyName',PropertyValue,...)
set(obj,PN,PV)
set(obj,S)
set(obj,'configuration', 'ConfigurationName',...)

Arguments

obj

An object or an array of objects.

'PropertyName'

A property name for obj.

PropertyValue

A property value supported by PropertyName.

PN

A cell array of property names.

PV

A cell array of property values.

props

A structure array whose field names are the property names for obj.

S

A structure with property names and property values.

'configuration'

Literal string to indicate usage of a configuration.

'ConfigurationName'

Name of the configuration to use.

Description

set(obj) displays all configurable properties for obj. If a property has a finite list of possible string values, these values are also displayed.

props = set(obj) returns all configurable properties for obj and their possible values to the structure props. The field names of props are the property names of obj, and the field values are cell arrays of possible property values. If a property does not have a finite set of possible values, its cell array is empty.

set(obj,'PropertyName') displays the valid values for PropertyName if it possesses a finite list of string values.

props = set(obj,'PropertyName') returns the valid values for PropertyName to props. props is a cell array of possible string values or an empty cell array if PropertyName does not have a finite list of possible values.

set(obj,'PropertyName',PropertyValue,...) configures one or more property values with a single command.

set(obj,PN,PV) configures the properties specified in the cell array of strings PN to the corresponding values in the cell array PV. PN must be a vector. PV can be m-by-n, where m is equal to the number of objects in obj and n is equal to the length of PN.

set(obj,S) configures the named properties to the specified values for obj. S is a structure whose field names are object properties, and whose field values are the values for the corresponding properties.

set(obj,'configuration', 'ConfigurationName',...) sets the object properties with values specified in the configuration ConfigurationName. For details about defining and applying configurations, see Programming with User Configurations.

Remarks

You can use any combination of property name/property value pairs, structure arrays, and cell arrays in one call to set. Additionally, you can specify a property name without regard to case, and you can make use of property name completion. For example, if j1 is a job object, the following commands are all valid and have the same result:

set(j1,'Timeout',20)
set(j1,'timeout',20)
set(j1,'timeo',20)

Examples

This example illustrates some of the ways you can use set to configure property values for the job object j1.

set(j1,'Name','Job_PT109','Timeout',60);

props1 = {'Name' 'Timeout'};
values1 = {'Job_PT109' 60};
set(j1, props1, values1);

S.Name = 'Job_PT109';
S.Timeout = 60;
set(j1,S);

See Also

get, inspect

  


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