Debugging

Diagnose problems in MuPAD® programs

Note

MuPAD notebooks will be removed in a future release. Use MATLAB® live scripts instead.

To convert a MuPAD notebook file to a MATLAB live script file, see convertMuPADNotebook. MATLAB live scripts support most MuPAD functionality, although there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

MuPAD Functions

argsAccess procedure parameters
assertAssertions for debugging
debugExecute a procedure in single-step mode
forceGarbageCollectionForce a garbage collection
prog::traceObserve functions
prog::tracedFind traced functions
prog::untraceTerminates observation of functions

Topics

Debug MuPAD Code Using the Debugger

Besides syntax errors such as misspelling a function name or omitting parenthesis, run-time errors can appear when executing your code.

Debug MuPAD Code in the Tracing Mode

MuPAD provides two alternatives for debugging your code.

Edit MuPAD Code in MATLAB Editor

MuPAD notebooks will be removed in a future release. Use MATLAB live scripts instead.

Display Progress

By default, MuPAD procedures do not show progress information or comments on run time.

Use Assertions

If you rely on correctness of particular statements for your code, then consider including these statements in the code.