Log Data for Selected Blocks Only - MATLAB & Simulink (original) (raw)

Instead of logging Simscapeā„¢ simulation data for the whole model, you can log data just for the selected blocks. The simulation log then contains logged data for all of the variables in the selected blocks.

Note

Alternatively, you can add instrumentation to Simscape blocks by selecting individual variables to log in aSimulink.SimulationOutput object, along with SimulinkĀ® variables and signals. For more information, see Log Selected Block Variables.

To enable Simscape data logging just for the selected blocks:

  1. In the model window, open the Modeling tab and clickModel Settings. The Configuration Parameters dialog box opens.
  2. In the Configuration Parameters dialog box, in the left pane, select Data Import/Export. Clear the Single simulation output check box, which is selected by default. This step enables associating the logged simulation data with a separate workspace variable, instead of it being part of the single output object.
  3. Set the logging configuration parameter to enable simulation data logging on a block-by-block basis.
    In the Configuration Parameters dialog box, in the left pane, selectSimscape, then set the Log simulation data parameter to Use local settings. ClickOK.
  4. Select the blocks in your model. You can do this before or after setting the logging configuration parameter.
    For each block that you want to select for data logging, right-click the block. From the context menu, select > . A check mark appears in front of the option.
  5. Simulate the model. When the simulation is done, the simulation data log contains only the data from the selected blocks.

To stop logging data for a previously selected block, right-click it and select > again to remove the check mark.

If you set the Log simulation data parameter toAll, the simulation log will contain data from the whole model, regardless of the block selections. Setting the Log simulation data parameter to None disables data logging for the whole model.

See Also

Topics