Simulink Reference    
get_param

Get system and block parameter values.

Syntax

Description

get_param('obj', 'parameter'), where 'obj' is a system or block path name, returns the value of the specified parameter. Case is ignored for parameter names.

get_param( { objects }, 'parameter') accepts a cell array of full path specifiers, enabling you to get the values of a parameter common to all objects specified in the cell array.

get_param(handle, 'parameter') returns the specified parameter of the object whose handle is handle.

get_param(0, 'parameter') returns the current value of a Simulink session parameter or the default value of a model or block parameter.

get_param('obj', 'ObjectParameters') returns a structure that describes obj's parameters. Each field of the returned structure corresponds to a particular parameter and has the parameter's name. For example, the Name field corresponds to the object's Name parameter. Each parameter field itself contains three fields, Name, Type, and Attributes, that specify the parameter's name (for example, "Gain"), data type (for example, string), and attributes (for example, read-only), respectively.

get_param('obj', 'DialogParameters') returns a cell array containing the names of the dialog parameters of the specified block.

Appendix , "Model and Block Parameters, contains lists of model and block parameters.

Examples

This command returns the value of the Gain parameter for the Inertia block in the Requisite Friction subsystem of the clutch system.

These commands display the block types of all blocks in the mx + b system (the current system), described in Masked Subsystem Example in Using Simulink.

This command returns the name of the currently selected block.

The following commands get the attributes of the currently selected block's Name parameter.

The following command gets the dialog parameters of a Sine Wave block.

See Also


  gcs new_system