Help CenterHelp 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 the fault_analyzer_intro model.
fault_analyzer_intro
openExample('faultanalyzer/FaultAnalyzerIntroExample')
Check if fault simulation is turned on for the model.
status = Simulink.fault.injection(... "fault_analyzer_intro");
Turn on fault simulation.
status = Simulink.fault.injection(... "fault_analyzer_intro",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.save
Simulink.fault.enable
Simulink.fault.isEnabled
Simulink.fault.save
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
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:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office