\section{GLOBAL Global Variables}

\subsection{Usage}

Global variables are shared variables that can be
seen and modified from any function or script that 
declares them.  The syntax for the \verb|global| statement
is
\begin{verbatim}
  global variable_1 variable_2 ...
\end{verbatim}
The \verb|global| statement must occur before the variables
appear.
\subsection{Example}

Here is an example of two functions that use a global
variable to communicate an array between them.  The
first function sets the global variable.
\begin{verbatim}
    set_global.m
function set_global(x)
  global common_array
  common_array = x;
\end{verbatim}
The second function retrieves the value from the global
variable
\begin{verbatim}
    get_global.m
function x = get_global
  global common_array
  x = common_array;
\end{verbatim}
Here we exercise the two functions
\begin{verbatim}
--> set_global('Hello')
--> get_global
ans = 
  <string>  - size: [1 5]
 Hello

\end{verbatim}
