title: sprintf in MATLAB
body: <p>How can I display the value of a variable inside the <code>sprintf</code> function in MATLAB? For example, I need to display </p>
  
  <blockquote>
    <p>This variable has the type <code>char</code> and the value <code>'whatever'</code>. </p>
  </blockquote>
  
  <p>My code looks like this so far: </p>
  
  <pre><code>function [desInput] = varInfo (numVec)  
  
  cLass = class(numVec);  
  var1 = num2str(numVec);  
  desInput = sprintf('This variable is of class %s and has a value of ''%d''.', cLass, var1);       
  
  end 
  </code></pre>
  
  <p>It isn't quite working right.</p>