Main Content

simscape.getFaultableElementsInBlock

Return faultable block subelements

Since R2023b

    Description

    faultableElements = simscape.getFaultableElementsInBlock(faultableBlock) returns an array of fault-capable element paths for the block, faultableBlock. If you specify the path of a composite component that contains fault-capable subcomponents, the function returns an array of element paths for each fault-capable subcomponent. If you specify the path of a composite component that contains fault-capable subcomponents, Simscape compiles the model to find the result. If you specify the path of an element with no fault capability, the function returns an empty array.

    example

    Examples

    collapse all

    This example shows how to get the fault element path for a fault-capable block in a model.

    Open a model with a block that supports fault modeling.

    openExample('simscape_shared/SimpleMotorArmatureWindingFaultExample')

    faultElements = simscape.getFaultableElementsInBlock('SimpleMotorArmatureWindingFault/DC Motor')
    faultElements = 
    
        "SimpleMotorArmatureWindingFault/DC Motor/Armature winding"

    Input Arguments

    collapse all

    Fault-capable block path, specified as a string scalar or character vector. If you input a path that does not contain a fault-capable block element, the function returns an empty array.

    Data Types: string | char

    Output Arguments

    collapse all

    Array of fault-capable elements, returned as a cell array.

    Version History

    Introduced in R2023b