Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

MATLAB being retarded or me ?

  1. Apr 11, 2010 #1
    i have this code

    A = [2 -2;-2 -1];
    if A==B
    disp('no match');

    they are the same, but i always get the output 'no match'

    any ideas?
  2. jcsd
  3. Apr 12, 2010 #2
    Technically A is not equal to B because the inverse algorithm gives only an approximation.

    To see this,

    Code (Text):
    >> orth([2 -2;-2 -1]) - inv(orth([2 -2;-2 -1]))
    ans =
      1.0e-015 *
       0.888178419700125  -0.444089209850063
      -0.388578058618805  -0.777156117237609
    So your expression is being analysed as false.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Threads - MATLAB being retarded Date
How to program this in Matlab Feb 28, 2018
Matlab Making a short test for self-adjointness Feb 23, 2018
Matlab Plotting Coordinate Transformations in Matlab Feb 12, 2018
Mathematica being very strange Jun 19, 2014