Table Of Contents

Debugging MATLAB® Functions and Scripts

Last Modified: February 19, 2020

You can debug MATLAB functions and scripts when you use an Interface for MATLAB to call them in your G dataflow application.

Complete the following steps to debug a function or script.

  1. In an Interface for MATLAB, ensure that you specify the correct file path to a MATLAB function or script.
  2. Click Open in MATLAB® to open the function or script in the MATLAB Editor.
  3. In the MATLAB Editor that launches, add a breakpoint on the line of code where you think the problem could be.
  4. Run your G dataflow application. The execution of the MATLAB function or script pauses at the specific line where you add the breakpoint.
  5. While the function or script is paused, you can view the value of each argument in the MATLAB Editor.
  6. Click Continue in the MATLAB Editor. The G dataflow application finishes executing the remaining code.
  7. Change the values of arguments or modify the script or function to produce expected results by using standard MATLAB functionality.

Recently Viewed Topics