Main Content

activate

Set fault as active fault

Since R2023b

Description

activate(fault) sets the fault, fault, as the active fault and enables the associated model element for fault simulation. If another fault on the same model element is active, the function deactivates the other fault.

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");

Set myFault as the active fault and enable fault simulation on the Sine Wave block output port.

activate(myFault);

Input Arguments

collapse all

Fault, specified as a Fault object.

Version History

Introduced in R2023b