title: How do I divide matrix by scalar in MATLAB?
body: <p>just having some issues dividing all the values of a matrix by a scalar using MATLAB.</p>
  
  <p>My code looked like,</p>
  
  <pre><code>ncol = length(indpic(1,:)); % ncol = 32
  row0 = sum(indpic == 0,2); % 161 * 1 matrix
  rowprob0 = 'row0' / 'ncol';
  </code></pre>
  
  <p>But the last line kept causing errors. I tried the following, but none of them worked either,</p>
  
  <pre><code>rowprob0 = 'row0' ./ 'ncol';
  rowprob0 = 'row0' * (1/('ncol'))';
  rowprob0 = 'row0' .* (1/('ncol'))';
  </code></pre>
  
  <p>I also attempted mucking around with this, but to even less avail,</p>
  
  <pre><code>ncol = length(indpic(1,:)); % ncol = 32
  row0 = sum(indpic == 0,2); % 161 * 1 matrix
  id_ncol_1 = eye(ncol,ncol);
  id_ncol = (id_ncol_1).*(ncol);
  rowprob0 = 'row0' / 'id_ncol';
  </code></pre>
  
  <p>If anyone can help me out, that'd be greatly appreciated :) cheers in advance</p>