Simulink.fault.isEnabled
Description
returns true for each model element in status
= Simulink.fault.isEnabled(modelElements
)modelElements
that is enabled
for fault injection.
Examples
Check if Faults on Model Element are Enabled
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");
Check if the Sine Wave block output port is enabled for fault simulation.
enabledStatus = Simulink.fault.isEnabled(... "fault_analyzer_intro/Sine Wave/Outport/1");
Input Arguments
modelElements
— Path or handle of model element
string array | cell array of character vectors | vector of handles
Paths or handles of model elements, specified as a string array, cell array of character vectors, or a vector of handles. If you specify only one model element, enter it as a scalar.
In Simulink® models, each entry in the array must be the path or handle of a block output or input port. In Simscape™ blocks, each entry in the array must be the path of a fault-capable model subelement. In System Composer™ models, each entry in the array must be the path to a component output or input port.
Example: "myModel/Sine
Wave/Outport/1"
Example: ["myModel/Sine
Wave/Outport/1" "myModel/Gain/Outport/1"]
Example: {'myModel/Sine
Wave/Outport/1', 'myModel/Gain/Outport/1'}
Data Types: string
| char
| double
Output Arguments
status
— Whether model elements are enabled
1
| 0
| logical array
Whether the model elements are enabled, returned as a 1
or
0
of data type logical
. Each value corresponds
to the element with them same index in the modelElements
input
argument.
Version History
Introduced in R2023b
MATLAB Command
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
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)