MATLAB Programming Fundamentals - MathWorks

(やまだぃちぅ) #1
The section evaluation features run the section code currently highlighted in yellow.
MATLAB does not automatically save your file when evaluating individual code sections.
The file does not have to be on your search path.

This table provides instructions on evaluating code sections.

Operation Instructions
Run the code in the
current section.


  • Place the cursor in the code section.


  • On the Editor tab, in the Run section, click Run
    Section.
    Run the code in the
    current section, and then
    move to the next section.



  • Place the cursor in the code section.


  • On the Editor tab, in the Run section, click Run and
    Advance.
    Run all the code in the file.• Type the saved script name in the Command Window.




  • On the Editor tab, in the Run section, click Run.




Increment Values in Code Sections

You can increment numbers within a section, rerunning that section after every change.
This helps you fine-tune and experiment with your code.

To increment or decrement a number in a section:

(^1) Highlight or place your cursor next to the number.
(^2) Right-click to open the context menu.
(^3) Select Increment Value and Run Section. A small dialog box appears.
(^4) Input appropriate values in the / text box or / text box.
5
Click the , , , or button to add to, subtract from, multiply, or divide the
selected number in your section.
18 Scripts

Free download pdf