title: How to store only upto 4 decimal places in a matlab variable?
body: <p>I want a variable in matlab to store(not to be confused with display) only upto 4 decimal places.
  Is there an inbuilt command for it?
  I tried the following - but this gives an error:</p>
  
  <pre><code>a = [5.21365458 5.236985475 1.236598547 9.3265874];
  
  k=1;
  for i=1:length(a)
  ast(k)=sprintf('%5.4f',a(i));
  anum(k)=str2num(ast(k));
  k=k+1;
  end
  </code></pre>
  
  <p>error is :  ??? Subscripted assignment dimension mismatch.</p>