MATLAB Programming Fundamentals - MathWorks

(やまだぃちぅ) #1
Local functions cannot access variables in the workspace of other functions or in the base
workspace, unless you pass them as arguments. For more information, see “Base and
Function Workspaces” on page 20-10.

Add and Run Sections in Live Scripts


The Live Editor does not support running individual sections within local functions. For
this reason, you cannot add section breaks within local functions in live scripts. When you
add local functions to a live script, MATLAB automatically adds a section break before the
first local function definition, and removes all section breaks after it. You can however run
individual sections within the script code, even if they contain a call to one of the local
functions in the file. For more information on section breaks and running live scripts, see
“Run Sections in Live Scripts” on page 19-14.

See Also


More About



  • “Create Functions in Files” on page 20-2

  • “Function Precedence Order” on page 20-43


18 Scripts

Free download pdf