Main Content

Debug Masks That Use MATLAB Code

Code Written in Mask Editor

Debug initialization commands and parameter callbacks entered directly into the Mask Editor by:

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

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


To stop debugging the mask initialization callback code when an error is encountered, use the command dbstop if caught error.

Code Written Using MATLAB Editor/Debugger


You cannot debug icon drawing commands using the MATLAB Editor/Debugger. For information on icon drawing commands syntax, see 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.

Related Topics