function Local_variable_demo()
%---------------------------------------------------------------
%       USAGE: Local_variable_demo()
%
%      AUTHOR: Dr. Wayne Brown           DATE: 22 Aug 05
%
% DESCRIPTION: Demonstrate the behavior of local variables 
%
%      INPUTS: None
%
%     OUTPUTS: None
%
%  REFERENCES: None
%---------------------------------------------------------------

if ~ exist('Counter', 'var')  % test to see if the variable Counter exists
    Counter = 1;              % initialize first time
else
    Counter = Counter + 1;    % increment other times
end

fprintf('Counter = %d\n', Counter)

end % function Local_variable_demo