Installation guide

6 Editing and Debugging M-Files
Navigating Among Cells in an M-File
To move to the next cell, select Cell > Next Cell.Tomovetothepreviouscell,
select Cell > Previous Cell. To move to a specific cell, click the Show Cell
Titles button
and from it, select the cell title to which you want to move.
Yo u can also go to cells by selecting Edit > Go To .
EvaluatingCellsinanM-File
To evaluate the code in a cell, use the Cell menu evaluation items or
equivalent buttons in the cell toolbar. When you evaluate a cell, the results
display in the Command Window, figure window, or otherwise, depending
onthecodeevaluated.
The cell evaluation features run the code currently shown in the
Editor/Debugger, even if the file contains u nsaved changes. The file does not
have to be on the search path. To evaluate a cell, it must contain all the values
it requires, or the values must already exist in the M ATLAB workspace.
Note While you can set breakpoints and debug a file containing cells, when
you evaluate a file from the Cell m enu or cell toolbar, breakpoints are ignored.
Torunthefileandstopatbreakpoints,useRun/Continue in the Debug
menu. This means you cannot debug while running a single cell.
Evaluate Current Cell. Select Cell > Evaluate Current Cell or click the
Evaluate Cell button
to run the code in the current cell.
Evaluate and Advance. Select Cell > Evaluate Current Cell and
Advance or click the Evaluate Cell and Advance button
to run the code in
the current cell and move to the next cell.
Evaluate File. Select Cell > Evaluate Entire File or click the Evaluate
Entire File button
to run all of the code in the file.
Note A beep means there is an error. See the Command Window for the
error message.
6-140