function predator_plot3d ( )

%*****************************************************************************80
%
%% predator_plot3d computes time/predator/prey data and makes a 3D plot
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    27 April 2018
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'predator_plot3d:\n' );
  fprintf ( 1, '  MATLAB version:\n' );
  fprintf ( 1, '  Model the interaction between rabbits and foxes.\n' );
%
%  Define N points (X,Y,Z) along a curve.
%
  n = 1001;

  dt = ( 5.0 - 0.0 ) / ( n - 1 );

  t = zeros ( n, 1 );
  prey = zeros ( n, 1 );
  pred = zeros ( n, 1 );

  t(1) = 0.0;
  prey(1) = 5000.0;
  pred(1) = 100.0;

  for i = 2 : n
    t(i) = t(i-1) + dt;
    prey(i) = prey(i-1) + dt * (    2.0 * prey(i-1) - 0.001 * pred(i-1) * prey(i-1) );
    pred(i) = pred(i-1) + dt * ( - 10.0 * pred(i-1) + 0.002 * pred(i-1) * prey(i-1) );
  end
%
%  Save the data to a file.
%
  data = [ t, prey, pred ];
  save ( 'predator_data.txt', 'data', '-ascii' );
%
%  Plot the curve.
%
  plot3 ( prey, pred, t, 'linewidth', 3 );
  grid ( 'on' );
  xlabel ( '<-- Prey -->', 'Fontsize', 16 );
  ylabel ( '<-- Predator -->', 'Fontsize', 16 );
  zlabel ( '<-- Time -->', 'Fontsize', 16 );
  title ( 'Predator/prey evolution', 'fontsize', 24 );
  
  view ( 3 );
%
%  Save the graphics in a file.
%
  filename = 'predator_plot3d.png';
  print ( '-dpng', filename );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'predator_plot3d:\n' );
  fprintf ( 1, '  Normal end of execution.\n' );

  return
end
