When you determine relative path for a block, the operating
point does not need to contain a node corresponding to that block. Use the
hasPath
function to determine whether the operating
point contains data at the specified location.
Open the Permanent Magnet DC Motor example model and create an
OperatingPoint
object named op
using
the Start
values from the model:
op =
OperatingPoint with children:
-----------------------------
DC Motor
DC Voltage
ERef
Load Torque
MRRef Motor
MRRef Torque
Sensing
-----------------------------
Open the DC Motor subsystem, select the
Inductor block, and find the relative
path to this block in the operating point data hierarchy:
relPath =
'DC Motor/Rotor Inductance'
Now determine whether the operating point contains data for this
block: