function z = crand ( m, n )

%*****************************************************************************80
%
%% crand() returns random complex values.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    04 June 2024
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer m, n: the number of rows and columns.
%
%  Output:
%
%    complex z(m,n): random complex values with normally distributed
%    radius r and uniformly distributed angle theta.
%
  if ( nargin < 2 )
    n = 1;
  end

  if ( nargin < 1 )
    m = 1;
  end

  r = randn ( m, n );
  theta = 2.0 * pi * rand ( m, n );
  z = r .* ( cos ( theta ) + sin ( theta ) * i );

  return
end
