Main Content

Simulink.fault.deleteAll

Delete faults and conditionals in models

Since R2025a

Description

Simulink.fault.deleteAll(model) deletes the faults and conditionals in the specified model.

example

Simulink.fault.deleteAll(model,Name=Value) deletes the faults or conditionals using one or more name-value arguments.

example

Examples

collapse all

Open a model with a block that supports fault modeling.

openExample("simscape_shared/SimpleMotorArmatureWindingFaultExample")

Add two faults to the Armature winding model subelement in the DC Motor block.

Simulink.fault.addFault(...
"SimpleMotorArmatureWindingFault/DC Motor/Armature winding");
Simulink.fault.addFault(...
"SimpleMotorArmatureWindingFault/DC Motor/Armature winding");

Add a conditional to the model.

Simulink.fault.addConditional("SimpleMotorArmatureWindingFault"...
,"myConditional","y1 >= 0");

Delete the faults and conditionals from the model.

Simulink.fault.deleteAll(
"SimpleMotorArmatureWindingFault");

Open a model with a block that supports fault modeling.

openExample("simscape_shared/SimpleMotorArmatureWindingFaultExample")

Add two faults to the Armature winding model subelement in the DC Motor block.

Simulink.fault.addFault(...
"SimpleMotorArmatureWindingFault/DC Motor/Armature winding");
Simulink.fault.addFault(...
"SimpleMotorArmatureWindingFault/DC Motor/Armature winding");

Add a conditional to the model.

Simulink.fault.addConditional("SimpleMotorArmatureWindingFault"...
,"myConditional","y1 >= 0");

Delete only the faults from the model.

Simulink.fault.deleteAll(
"SimpleMotorArmatureWindingFault",Conditionals=false);

Input Arguments

collapse all

Path or handle to the model, specified as a string scalar, character vector, or model handle.

Data Types: string | char | double

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: Simulink.fault.deleteAll("myModel",Conditionals=false) deletes only the faults from the model, myModel.

Whether to delete the faults in the model, specified as a numeric or logical 1 (true) or 0 (false).

Data Types: logical

Whether to delete the conditionals in the model, specified as a numeric or logical 1 (true) or 0 (false).

Data Types: logical

Algorithms

This function may delete the fault information file and fault model depending on how you specify the name value arguments:

Conditionals SettingFaults SettingResult
truetrueThe function deletes the fault model and the fault information file.
falsetrue If the model has conditionals, the function retains the fault information file but deletes the fault model. If the model does not have conditionals, the function deletes both files.
truefalseIf your model has faults, the function keeps both files. If the model does not have faults, the function deletes the fault information file.
falsefalseThe function does nothing

For more information on the supporting files, see Introduction to Simscape Faults.

Version History

Introduced in R2025a