Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

Please go through the subfunction page (or local function as MATLAB calls it) in its entirety before watching the following tutorial video. 

HTML
Wiki Markup
{html}<iframe width="600" height="338" src="//www.youtube.com/embed/ld3Li5BAU78?rel=0" frameborder="0" allowfullscreen></iframe>{html}


Your main_function file should look like this. 

...

The last paragraph of the Local Functions documentation page says that "All functions, including local functions, have their own workspace that are separate from the base workspace.  Local functions cannot access variables used by other functions unless you pass them as arguments" and vice-versa. The following video covers this very important concept. 

HTML
Wiki Markup
{html}<iframe width="600" height="338" src="//www.youtube.com/embed/pnzydaFyEa4?rel=0" frameborder="0" allowfullscreen></iframe>{html}

That brings us to the end of this tour. Before we part, let's remind ourselves of some important programming guidelines that we have followed in this tour:

...