Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

라이선스가 부여된 사용자만 번역 문서를 볼 수 있습니다. 번역 문서를 보려면 로그인하십시오.

Debugging

Diagnose problems with programs

You can diagnose problems with your MATLAB® program either graphically or programmatically. Both approaches allow you to set breakpoints to pause the execution of your MATLAB program so you can examine values where you think a problem could be.

    Note:   Debugging using the graphical debugger is not supported in live scripts. For more information, see What Is a Live Script?.

Functions

dbclear Remove breakpoints
dbcont Resume execution
dbdown Reverse dbup workspace shift
dbquit Quit debug mode
dbstack Function call stack
dbstatus List all breakpoints
dbstep Execute next executable line from current breakpoint
dbstop Set breakpoints for debugging
dbtype Display file with line numbers
dbup Shift current workspace to workspace of caller in debug mode
checkcode Check MATLAB code files for possible problems
keyboard Input from keyboard
mlintrpt Run checkcode for file or folder

Topics

Debug a MATLAB Program

To debug your MATLAB program graphically, use the Editor/Debugger. Alternatively, you can use debugging functions in the Command Window.

Set Breakpoints

To pause the execution of your MATLAB program so that you can examine values where you think a problem might be, set breakpoints.

Set breakpoints to stop at a specified line in a file, at a specified line in a file only when the specified condition is met, or when MATLAB encounters an error.

Examine Values While Debugging

While your program is paused, view the value of any variable currently in the workspace to see if a line of code produces the expected result.

Was this topic helpful?