title: Matlab - Append a new Column to a matrix
body: <p>I'm a noob in the world of Matlab and I want to append a single value in the beginning of all rows in a matrix.</p>
  
  <pre><code>mat =
  
  16     2     3    13
   5    11    10     8
   9     7     6    12
   4    14    15     1
  
  myval = 98;
  </code></pre>
  
  <p>I want  to get a matrix like:</p>
  
  <pre><code>mat =
  
  98   16     2     3    13
  98    5    11    10     8
  98    9     7     6    12
  98    4    14    15     1
  </code></pre>
  
  <p>What should I do?</p>
  
  <p>I know that we can use horizontal concatenation like <code>[a b]</code> but here <code>myval</code> and <code>mat</code> are not of the same dimension </p>
  
  <p>I did this like:</p>
  
  <pre><code>m  = ones(4,1)*98
  
  m =
  
  98
  98
  98
  98
  
  mat = [m mat]
  
   mat =
  
  98    16     2     3    13
  98     5    11    10     8
  98     9     7     6    12
  98     4    14    15     1
  </code></pre>
  
  <p>Is there a better way ?</p>
  
  <p>Thank you</p>