title: Matlab - Sparse Matrix system resolution
body: <p>I'm involved in the resolution of a system of the type <code>Ax = b</code>, where A is a square sparse matrix, x is the vector of the unknows (I have to compute it) and b is a vector of all zeros excpet for the last element which is a 1.
  The last row of the matrix A is used for normalization, and so is fulfilled with ones.</p>
  
  <p>The solutions of this system are probabilities and for this reason the condition <code>0&lt;x(i)&lt;1</code> must be respected.</p>
  
  <p>In order to solve the system the Matlab command <code>x = A \ b;</code> is used.</p>
  
  <p>The method seems to work well, but there is a special case in wich the vector x also contains negative values. Adding a very small value (10^-6) to any element of the Matrix A, the resolution back to meet the conditions.</p>
  
  <p>I'm not a mathematician, so I don't know if it's a code problem, or if the matrix A must respect some properties to guarantee that the solutions are all between 0 and 1.</p>