Local functions: are subroutines that are available within the same file. Local functions are the most common way to break up programmatic tasks. In a function file, which contains only function definitions, local functions can appear in the file in any order after the main function in the file. In a script file, which contains commands and function definitions, the local function must be at the end of the file.
Nested functions: are completely contained within another function. The primary difference between nested functions and local functions is that nested functions can use variables defined in parent functions without explicitly passing those variables as arguments. They are useful when subroutines share data, such as applications that pass data between components.
Private Functions: are functions that exist in a subfolder named private, so they are available only to functions in the folder immediately above the private folder. These functions are used to separate code into different files or to share code between multiple, related functions.
Anonymous Functions: allow us to define a function without creating a program file, as long as the function consists of a single statement. A common application of anonymous functions is to define a mathematical expression, and then evaluate that expression over a range of values using a function handle.