Main Content

Plot Signal Data Logged to File

You can use the MATLAB® plotting functions for visualization of your non-real-time simulated data or your real-time executed data.

After running your real-time application and logging data to a file, you can plot the data.

This procedure uses the model sldrtex_model. To open this model, in the MATLAB Command Window, type:

open_system(docpath(fullfile(docroot, 'toolbox', 'sldrt', 'examples', 'sldrtex_model')))

It assumes that you saved your data to the variable ScopeData.

  1. In the MATLAB Command Window, type:

    ScopeData = 
           time: [10000x1 double]
        signals: [1x1 struct]
      blockName: 'sldrtex_model/Scope'
  2. To list the MAT-files saved to your disk, type:

    dir *.mat
  3. To clear the MATLAB workspace and load the scope data, type:

    load ScopeData 
    Your variables are:
  4. To plot the first 1000 points, type:


    The MATLAB environment plots the first 1000 samples over 0.0000–0.9990 seconds.

Related Topics