MATLAB 帮助中心
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
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.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处