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];
    A=orth(A);
    B=inv(A);
    if A==B
    disp('match');
    else
    disp('no match');
    end

    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 Discussions: MATLAB being retarded or me ?
Loading...