gcb

Get pathname of current block

Syntax

gcb
gcb('sys')

Description

gcb returns the full block pathname of the current block in the current system.

gcb('sys') returns the full block pathname of the current block in the specified system.

The current block is one of these:

  • During editing, the current block is the block most recently clicked.

  • During simulation of a system that contains S-Function blocks, the current block is the S-Function block currently executing its corresponding MATLAB® function.

  • During callbacks, the current block is the block whose callback routine is being executed.

  • During evaluation of the MaskInitialization string, the current block is the block whose mask is being evaluated.

Examples

This command returns the path of the most recently selected block.

gcb
ans =
   clutch/Locked/Inertia

This command gets the value of the Gain parameter of the current block.

get_param(gcb,'Gain')
ans =
   1/(Iv+Ie)

See Also

|

Was this topic helpful?