Documentation

Set External Mode Data Archiving Parameters

You must select the Save data to workspace check box in the Scope parameters dialog box for the software to save data in the data logging MAT-files.

This procedure uses the model sldrtex_model (matlab: open_system(docpath(fullfile(docroot, 'toolbox', 'sldrt', 'examples', 'sldrtex_model')))). It assumes that you have already loaded that model.

After you create a Simulink® model, you can enter the Data Archiving Parameters for data logging to a file:

  1. In the Simulation window, click Code > External Mode Control Panel.

  2. Click the Data Archiving button.

  3. Select the Enable archiving check box.

  4. In the Directory text box, enter the path to a folder on your disk. For example, if your MATLAB® working folder is named mwd, enter

    c:\mwd
    
  5. In the File text box, enter the file name prefix for the data files to be saved. For example, enter:

    data
    

    The MATLAB environment names the files data_0.mat, data_1.mat, and so on. The number of files equals the total sample points. For example, if you set Duration to Total sample points, then only one file is created.

  6. Select the Append file suffix to variable names check box.

  7. Click the Close button.

Was this topic helpful?