Main Content

Simulink.fault.getFaultModels

Return fault models associated with model

Since R2023b

Description

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

example

Examples

collapse all

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"...
,Name="myFault1");

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");

Get the name of the fault model.

fm = Simulink.fault.getFaultModels(...
"fault_analyzer_intro");

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