Main Content

deleteBehavior

Delete behavior associated with fault

Since R2023b

Description

example

deleteBehavior(fault) deletes the fault behavior associated with the fault, 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");

Delete the behavior.

deleteBehavior(myFault);

Input Arguments

collapse all

Fault, specified as a Fault object.

Tips

  • Deleting faults also deletes the associated fault behavior in the fault model. To delete a fault, use the Simulink.fault.deleteFault function.

  • Deleting fault behaviors automatically saves the fault information file.

  • If you delete a fault behavior and it is the only one in the fault model, you also delete the fault model.

Version History

Introduced in R2023b