function octave_mistake_test02 ( )

%*****************************************************************************80
%
%% octave_mistake_test02() creates the second difference matrix...or tries to!
%
%  Discussion:
%
%    We want to create the matrix:
%
%     2 -1  0  0  0
%    -1  2 -1  0  0 
%     0 -1  2 -1  0
%     0  0 -1  2 -1
%     0  0  0 -1  2
%
%    As you can see, that doesn't happen!  Why not?
%
%    Is "else if" the same as "elseif"?  (Hint: NO!)
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    04 July 2016
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'octave_mistake_test02():\n' );
  fprintf ( 1, '  Try to create the -1, 2, -1 tridiagonal matrix.\n' );

  m = 5;
  n = 5;
  a = zeros ( m, n );

  for i = 1 : m
    for j = 1 : n

      if ( j == i - 1 | j == i + 1 )
        value = - 1.0; 
      else if ( j == i )
        value = 2.0;
      else
        value = 0.0;
      end

      a(i,j) = value;

    end
  end

  a

  return
end

