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 Fault Modeling Status
Open a model with a block that supports fault modeling.
openExample('simscape_shared/SimpleMotorArmatureWindingFaultExample')
Add a fault to the Armature winding
model subelement in the
DC Motorblock.
Simulink.fault.addFault(... "SimpleMotorArmatureWindingFault/DC Motor/Armature winding");
Assign behavior to the fault and store the behavior in a fault model named
myBehaviorModel
on the path.
addBehavior(myFault,"myBehaviorModel")
Check if the armature winding is enabled for faults.
enabledStatus = Simulink.fault.isEnabled(... "SimpleMotorArmatureWindingFault/DC Motor/Armature winding");
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.
Each entry in the array must be the path of a fault-capable model subelement.
Example: "myModel/DC
Motor/Armature winding"
Example: ["myModel/DC Motor/Armature winding" "myModel/RC
Servo/Servo"]
Example: ['myModel/DC Motor/Armature winding', 'myModel/RC
Servo/Servo']
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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)