title: matlab: converting a vector to a cell array of strings
body: <p>I'm sure there's a way to do this but I don't know what it is.</p>
  
  <p>Suppose I have a vector</p>
  
  <pre><code>v = [1.02 2.03 3.04];
  </code></pre>
  
  <p>and I want to convert this to a cell array using a format string for each element:</p>
  
  <pre><code>'   %.3f'
  </code></pre>
  
  <p>(3 spaces before the %.3f)</p>
  
  <p>How can I do this? I tried the following approach, but I get an error:</p>
  
  <pre><code>&gt;&gt; f1 = @(x) sprintf('   %.3f',x);
  &gt;&gt; cellfun(f1, num2cell(v))
  ??? Error using ==&gt; cellfun
  Non-scalar in Uniform output, at index 1, output 1.
  Set 'UniformOutput' to false.
  </code></pre>