MATLAB runs the section after every click.
NoteMATLAB software does not automatically save changes you make to the numbers in
your script.
Navigate Among Code Sections in a File
You can navigate among sections in a file without evaluating the code within those
sections. This facilitates jumping quickly from section to section within a file. You might
do this, for example, to find specific code in a large file.
Operation Instructions
Move to the next section. •
On the Editor tab, in the Run section, click Advance.
Move to the previous
section.
- Press Ctrl + Up arrow.
Move to a specific section. •
On the Editor tab, in the Navigate section, use the
Go To to move the cursor to a selected section.
Example of Evaluating Code Sections
This example defines two code sections in a file called sine_wave.m and then increments
a parameter to adjust the created plot. To open this file in your Editor, run the following
command, and then save the file to a local folder:
edit(fullfile(matlabroot,'help','techdoc','matlab_env',...
'examples','sine_wave.m'))
After the file is open in your Editor:
1 Insert a section break and the following title on the first line of the file.
%% Calculate and Plot Sine Wave
2 Insert a blank line and a second section break after plot(x,y). Add a section title,
Modify Plot Properties, so that the entire file contains this code:
%% Calculate and Plot Sine Wave
% Define the range for x.
Code Sections