Using Simulink | ![]() ![]() |
How to Specify a Path for a Simulink Object
Many of the commands described in this chapter require that you identify a Simulink system or block. Identify systems and blocks by specifying their paths:
mdl
extension.system
system/subsystem1/.../subsystem
system/subsystem1/.../subsystem/block
If the block name includes a newline or carriage return, specify the block name as a string vector and use sprintf('\n')
as the newline character. For example, these lines assign the newline character to cr
, then get the value for the Signal Generator block's Amplitude parameter.
cr = sprintf('\n'); get_param(['untitled/Signal',cr,'Generator'],'Amplitude') ans = 1
If the block name includes a slash character (/), you repeat the slash when you specify the block name. For example, to get the value of the Location
parameter for the block named Signal/Noise
in the mymodel
system.
get_param('mymodel/Signal//Noise','Location')
![]() | How to Specify Parameters for the Commands | add_block | ![]() |