title: passing varargin to subfunction if string
body: <p>I want to modify function rand and define my own function </p>
  
  <pre><code>function num = rand(varargin) 
  </code></pre>
  
  <p>Most of the time, i just wrap the invocation </p>
  
  <pre><code>num = builtin("rand", [varargin{:}]);
  </code></pre>
  
  <p>and this works well except in case there is a string argument. </p>
  
  <p>For <code>rand(2,3,"double")</code> I obtain </p>
  
  <pre><code>warning: implicit conversion from numeric to char
  warning: called from rand at line 83 column 11
  error: rand: unrecognized string argument
  error: called from rand at line 83 column 11
  </code></pre>
  
  <p>and for <code>rand("seed",2)</code> the same. </p>
  
  <p>ON the other hand, <code>rand("seed")</code> seems to work fine. </p>
  
  <p>Can anyone offer an explanation and a solution?</p>