title: Solving 2 equations - 9 Unknowns, with constraints.
body: <p>I'm trying to solve a riddle with the use of matlab. 
  This is realy more about matlab than the riddle itself (The riddle is taken from a daily newspaper). </p>
  
  <p>The riddle gives two 3 digits numbers represented by letters. I need to find the digit (0-9) the doesn't participate. </p>
  
  <blockquote>
    <p>aba-dcc=efe   ;   aba+dcc=ghi</p>
  </blockquote>
  
  <p>Now, I have 2 equations with 9 unknowns. 
  I've managed to solve it by checking all permutations of the vector 0:9, in a while loop.</p>
  
  <pre><code>vecAns = 0:9;
  P = perms(vecAns);
  P = P(:,1:9);
  
  A = [ 101 10 -100 -11 -101 -10 0 0 0 ;...
          101 10 100 11 0 0 -100 -10 -1];
  
  resVec = [0;0];
  found=false;
  
  i=1;
  h = waitbar(0,'Computing');
  while found==false
          Res=A*P(i,:)';
          if (Res(1)==0)&amp;&amp;(Res(2)==0)
              break;
          end
          i=i+1;
          waitbar(i/length(P),h,sprintf('%d%%',i/length(P)*100));
  end
  close(h) 
  </code></pre>
  
  <p>Is there a way (without adding mathematical considerations) to solve the problem. 
  For example, I know that all the unknowns must be integers and within the range 0-9. </p>
  
  <p>If there isn't a way. How can make it more efficient? </p>