Main Content

simscape.instrumentation.enableLogging

Enable logging for block

Since R2024a

    Description

    example

    simscape.instrumentation.enableLogging(blockName) enables logging for the block, blockName. If none of the block variables are selected for logging, the function selects all the variables for logging. If you enable logging for a block that already has block variables selected, the function logs only the selected variables.

    Examples

    collapse all

    This example shows how to enable logging for the Ideal Torque Source block labeled Load Torque in the Permanent Magnet DC Motor example model.

    To open the model, enter:

    openExample('simscape/PermanentMagnetDCMotorExample')

    To enable selective logging for the block, enter:

    simscape.instrumentation.enableLogging('PermanentMagnetDCMotor/Load Torque')
    Because the block did not previously have any variables selected for logging, the function selects all of the variables for the block. Confirm that the logging badge appears on the Ideal Torque Source block.

    Input Arguments

    collapse all

    Simscape block name, specified as a string scalar, character vector, or a handle.

    Data Types: double | char | string

    Version History

    Introduced in R2024a