Simple But Devious MATLAB Programming Mistakes
MATLAB programs which
illustrate some simple but devious programming mistakes in MATLAB.
The computer code and data files made available on this web page
are distributed under
the GNU LGPL license.
MATLAB_MISTAKE is available in
a C version and
a FORTRAN90 version and
an HTML version and
a MATLAB version.
we put numbers in an array, except they don't seem to get there!
we try to create the -1, 2, -1 tridiagonal matrix but...we don't!
we try to create the array [ cos ( alpha ), sin ( alpha ) ] but...we can't!
the command "abs x" seems to work...almost.
variations of the command "B=1./A" can fail.
v = rand(3) is NOT a 3-vector.
prints the YMDHMS date as a timestamp.
Examples and Tests:
Last revised on 09 February 2019.