function temperature_prepare ( )

%*****************************************************************************80
%
%% TEMPERATURE_PREPARE extracts data from MAT file, writes to TXT file.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    08 May 2018
%
%  Author:
%
%    John Burkardt
%
  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'TEMPERATURE_PREPARE:\n' );
  fprintf ( 1, '  MATLAB/Octave version %s:\n', version ( ) );
  fprintf ( 1, '  Read a cityname/temperature/latitude/longitude MAT file.\n' );
  fprintf ( 1, '  Write a temperature/latitude/longitude TXT file.\n' );
%
%  Read the MAT file.
%
  filename = 'temperature_data.mat';
  load ( filename );
%
%  Combine the data into one array.
%
  tll = [ temperature, -longitude, latitude ];
%
%  Save the array.
%
  filename = 'temperature_data.txt';
  save ( filename, '-ascii', 'tll' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Data saved to file "%s"\n', filename );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'TEMPERATURE_PREPARE:\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  timestamp ( );

  return
end

