Debug Masks That Use MATLAB Code

Code Written in Mask Editor

Debug initialization commands and parameter callbacks entered directly into the Mask Editor in one of the following ways:

  • Remove the terminating semicolon from a command to echo its results to the MATLAB® Command Window.

  • Place a keyboard command in the code to stop execution and give control to the keyboard.

Code Written Using MATLAB Editor/Debugger

    Note:   You cannot debug icon drawing commands using the MATLAB Editor/Debugger. Use the syntax examples provided in the Mask Editor Icons & Ports pane to help solve errors in the icon drawing commands.

Debug initialization commands and parameter callbacks written in files using the MATLAB Editor/Debugger in the same way that you would with any other MATLAB program file.

When debugging initialization commands, you can view the contents of the mask workspace. However, when debugging parameter callbacks, you can only access the base workspace of the block. If you need the value of a mask parameter, use get_param.

Was this topic helpful?