function [ a_out, b_out, c_out ] = abc ( a_in, b_in, c_in )

%*****************************************************************************80
%
%% abc() stores, saves, and returns varables "a", "b" and "c".
%
%  Discussion:
%
%    Calling abc() with no input arguments returns the current
%    values of A, B, and C.
%
%    Calling abc(a_in,b_in,c_in) supplies new values for A, B,
%    and C which overwrite the current values.
%
%    MATLAB offers an "arguments" interface that would greatly simplify
%    and strengthen this work, but it DOES NOT WORK as advertised.
%    Not for me, anyway.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    06 May 2021
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real A_IN: a new value for A.
%
%    real B_IN: a new value for B.
%
%    real C_IN: a new value for C.
%
%  Persistent:
%
%    real A_DEFAULT: the current value of A.
%
%    real B_DEFAULT: the current value of B.
%
%    real C_DEFAULT: the current value of C.
%
%  Output:
%
%    real A_OUT: the current value of A.
%
%    real B_OUT: the current value of B.
%
%    real C_OUT: the current value or C.
%


%
%  Persistent data stores the current values.
%
  persistent a_default
  persistent b_default
  persistent c_default
%
%  Initialize the current values once.
%
  if ( isempty ( a_default ) )
    a_default = 1.0;
  end

  if ( isempty ( b_default ) )
    b_default = 2.0;
  end

  if ( isempty ( c_default ) )
    c_default = 3.0;
  end
%
%  New values, if supplied on input, overwrite the current values.
%
  if ( 1 <= nargin )
    a_default = a_in;
  end

  if ( 2 <= nargin )
    b_default = b_in;
  end

  if ( 3 <= nargin )
    c_default = c_in;
  end
%
%  The current values are copied to the output.
%
  a_out = a_default;
  b_out = b_default;
  c_out = c_default;

  return
end

