Main Content

getBehavior

Get path of associated Fault Subsystem block

Since R2023b

Description

path = getBehavior(fault) returns the path of the Fault Subsystem block assigned to the fault, fault.

example

Examples

collapse all

Open the fault_analyzer_intro model.

openExample('faultanalyzer/FaultAnalyzerIntroExample')

Add a fault to the Sine Wave block output port.

myFault = Simulink.fault.addFault(...
"fault_analyzer_intro/Sine Wave/Outport/1");

Assign noise behavior to the fault and store the behavior in a fault model named myBehaviorModel on the path.

addBehavior(myFault,"myBehaviorModel",...
FaultBehavior="mwfaultlib/Add Noise");

Retrieve the path of the Fault Subsystem block associated with myFault.

myBehaviorPath = getBehavior(myFault)
myBehaviorPath =

    'myBehaviorModel/SineWave_Outport1_fault'

Input Arguments

collapse all

Fault, specified as a Fault object.

Output Arguments

collapse all

Path of the fault subsystem, returned as a character vector.

Version History

Introduced in R2023b