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