Main Content

addBehavior

Add signal behavior to fault

Since R2023b

Description

addBehavior(fault,faultModel) adds fault behavior to the fault, fault, and stores the fault behavior parameters in the fault model, faultModel.

example

addBehavior(fault,faultModel,Name=Value) adds the fault behavior to the fault using one or more name-value arguments.

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 an empty behavior to the fault.

addBehavior(myFault,"myBehaviorModel");

Input Arguments

collapse all

Fault, specified as a Fault object.

File name of the fault model, specified as a string scalar or character vector. The function creates a Fault Subsystem block that models the behavior in this fault model.

Data Types: char | string

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: addBehavior(fault,"myBehaviorModel",FaultModelDir="C:\myFiles") adds behavior to the fault, fault, in the fault model, myBehaviorModel, and stores the fault model in the C:\myFiles folder.

Directory of the fault model, specified as a string scalar or character vector. If you enter an empty string or character vector, the function uses the current directory. The directory must exist before you specify it.

Data Types: char | string

Limitations

After you add behavior to a fault, you cannot add additional behavior to the fault.

Version History

Introduced in R2023b

See Also