title: Solving A Matrix Equation Symbolically
body: <p>I am trying out Matlab, and am currently trying to solve a simple matrix equation that I made up. Here is my script:</p>
  
  <pre><code>syms b1 b2 b3 
  
  A = [1 2; 2 1; 3 3];
  
  B = [b1; b2; b3];
  
  X = linsolve(A, B)
  </code></pre>
  
  <p>The output is </p>
  
  <pre><code>Warning: System is inconsistent.
  Solution does not exist. 
  
  X =
  
   Inf
   Inf
  </code></pre>
  
  <p>What might I be doing wrong?</p>
  
  <hr>
  
  <p>EDIT: </p>
  
  <p>Okay, I was able to fix it. However, now I am trying to accomplish something else.</p>
  
  <p>Here is what I type in:</p>
  
  <pre><code>C = [1 2 3 b1; 2 1 6 b2; 3 3 5 b3];
  
  rref(C)
  </code></pre>
  
  <p>and the result is:</p>
  
  <pre><code>[ 1, 0, 0, (3*b3)/4 - b2/12 - (13*b1)/12]
  [ 0, 1, 0,               (2*b1)/3 - b2/3]
  [ 0, 0, 1,            b1/4 + b2/4 - b3/4]
  </code></pre>
  
  <p>However, what I would like is to have create a matrix such that the third row is 0 = f(b1, b2, b3), that is, I would like the third row to be 0 on the LHS and the RHS only involves b1, b2, and/or b3. How might I go about this? I tried making every entry into a variable, but this didn't seem to work.</p>
  
  <p>This is what the output was:</p>
  
  <pre><code>[ 1, 0, 0,  (a2*a6*b3 - a3*a5*b3 - a2*a9*b2 + a3*a8*b2 + a5*a9*b1 - a6*a8*b1)/(a1*a5*a9 - a1*a6*a8 - a2*a4*a9 + a2*a6*a7 + a3*a4*a8 - a3*a5*a7)]
  [ 0, 1, 0, -(a1*a6*b3 - a3*a4*b3 - a1*a9*b2 + a3*a7*b2 + a4*a9*b1 - a6*a7*b1)/(a1*a5*a9 - a1*a6*a8 - a2*a4*a9 + a2*a6*a7 + a3*a4*a8 - a3*a5*a7)]
  [ 0, 0, 1,  (a1*a5*b3 - a2*a4*b3 - a1*a8*b2 + a2*a7*b2 + a4*a8*b1 - a5*a7*b1)/(a1*a5*a9 - a1*a6*a8 - a2*a4*a9 + a2*a6*a7 + a3*a4*a8 - a3*a5*a7)]
  </code></pre>