Main Content

Log and View Simulation Data for Selected Blocks

This example shows how you can set your model to log simulation data for selected blocks only and how to view simulation data using Simscape™ Results Explorer.

  1. Open the Permanent Magnet DC Motor example model. At the MATLAB® command prompt, enter:

    openExample('simscape/PermanentMagnetDCMotorExample')
  2. Double-click the DC Motor subsystem to open it.

  3. Open the Configuration Parameters dialog box and then, in the left pane, select Simscape. This example model has data logging for the whole model enabled. To enable data logging on a block-by-block basis, set the Log simulation data parameter to Use local settings and click OK.

  4. Select the blocks for data logging. Click the Rotational Electromechanical Converter block, and then, on the Simscape Block tab, click Log Data and select the Log Data check box.

  5. Right-click the Inertia block and select it for data logging, as described in the previous step.

  6. Simulate the model. This creates a workspace variable named simlog_PermanentMagnetDCMotor (as specified by the Workspace variable name parameter), which contains the simulation data for selected blocks only.

  7. To open the Simscape Results Explorer, click one of the blocks previously selected for data logging, for example, the Rotational Electromechanical Converter block, and then, on the Simscape Block tab, click Results Explorer.

    The Simscape Results Explorer window opens, with the Rotational Electromechanical Converter node already selected in the left pane and all the node plots for this block displayed in the right pane. You can see that it contains simulation data only for the two selected blocks, Rotational Electromechanical Converter and Inertia.

See Also

Related Examples

More About