Help Center
Enable fault simulation for model
Since R2023b
isOn = Simulink.fault.injection(model)
isOn = Simulink.fault.injection(model,status)
isOn = Simulink.fault.injection(model) returns 1 if the model model has fault simulation turned on.
isOn
model
1
example
isOn = Simulink.fault.injection(model,status) turns fault simulation on or off based on the value of status.
status
collapse all
Open a model with a block that supports fault modeling.
openExample('simscape_shared/SimpleMotorArmatureWindingFaultExample')
Check if fault simulation is turned on for the model.
status = Simulink.fault.injection("SimpleMotorArmatureWindingFault");
Turn on fault simulation.
status = Simulink.fault.injection(... "SimpleMotorArmatureWindingFault",true);
Path or handle to the model, specified as a string scalar, character vector, or model handle.
Data Types: string | char | double
string
char
double
true
false
0
Fault simulation status, specified as a numeric or logical 1 (true) or 0 (false). Enter 1 or true to turn on fault simulation.
Data Types: logical
logical
Previous fault simulation status of the model, returned as a 1 or 0 of data type logical.
Introduced in R2023b
Simulink.fault.enable | Simulink.fault.isEnabled
Simulink.fault.enable
Simulink.fault.isEnabled
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
Europe
Asia Pacific
Contact your local office