title: Solving a linear system of equation with two variables in MATLAB
body: <p>It might seem a simple question. I need it, though. Let's assume we have two equations:</p>
  
  <blockquote>
    <p>2 * y + x + 1 = 0</p>
    
    <p>and</p>
    
    <p>y - 2 * x = 0</p>
  </blockquote>
  
  <p>I would like to find their bisection which can be calculated from this equation:</p>
  
  <pre><code>  |x + 2 * y + 1|        |-2 *x +  y |
  ------------------- = ----------------- 
  (sqrt(2^2 + 1^2))      (sqrt(1^2 + 2^2))
  </code></pre>
  
  <p>To make the long story short, we only need to solve this below system of equation:</p>
  
  <pre><code>2 * y + x + 1 = -2 *x +  y  
  and
  2 * y + x + 1 =  2 *x -  y 
  </code></pre>
  
  <p>However, using <code>solve</code> function of MATLAB:</p>
  
  <pre><code>syms x y
  eqn1   = 2 * y + x + 1 == -2 *x +  y ;
  eqn2   = 2 * y + x + 1 ==  2 *x -  y ;
  [x, y] = solve (eqn1 , eqn2, x, y)   ;
  </code></pre>
  
  <p>Will give me:</p>
  
  <p><code>x = -1/5</code> and <code>y = -2/5</code></p>
  
  <p>But, I am looking for the result equations, which is: </p>
  
  <p><code>y = -3 * x - 1</code> and <code>3 * y = 2 * x  - 1</code></p>
  
  <p>So, does anyone know how I can get the above line equation instead of the result point? Thanks, </p>