Main Content

Simulink.fault.getFaultModels

Return fault models associated with model

Since R2023b

Description

example

faultModel = Simulink.fault.getFaultModels(model) returns the names of the fault models associated with the model, model.

Examples

collapse all

Open a model with a block that supports fault modeling.

openExample('simscape_shared/SimpleMotorArmatureWindingFaultExample')

Add a fault to the DC Motor block.

myFault = Simulink.fault.addFault(...
"SimpleMotorArmatureWindingFault/DC Motor/Armature winding");

Add behavior to the fault.

addBehavior(myFault,"myBehaviorModel");

Get the name of the fault model.

fm = Simulink.fault.getFaultModels("SimpleMotorArmatureWindingFault")
fm =

  1×1 cell array

    {'myBehaviorModel'}

Input Arguments

collapse all

Path or handle to the model, specified as a string scalar, character vector, or model handle.

Data Types: string | char | double

Output Arguments

collapse all

Fault models associated with the model, returned as a cell array of character vectors.

Version History

Introduced in R2023b

See Also

Objects