title: How to separate the elements of a matrix with comma in Matlab
body: <p>I would like to separate each element in the matrix below with a comma. </p>
  
  <pre><code>1     2     3   
  4     5     6   
  7     8     9
  </code></pre>
  
  <p>Here's my attempt:</p>
  
  <pre><code>s= sprintf('%.17g,',matrix)
  </code></pre>
  
  <p>Ouput=<code>1,2,3,4,5,6,7,8,9,</code></p>
  
  <p>Desired output:</p>
  
  <pre><code>1,     2,     3   
  4,     5,     6   
  7,     8,     9
  </code></pre>
  
  <p>Thanks in advance for your suggestions.</p>