title: How to let fminsearch only search over integers?
body: <p>I'm using the <a href="http://ch.mathworks.com/help/matlab/ref/fminsearch.html" rel="nofollow">fminsearch</a> Method of Matlab to minimize a function:</p>
  
  <pre><code>c = cvpartition(200,'KFold',10);
  minfn = @(z)kfoldLoss(fitcsvm(cdata,grp,'CVPartition',c,...
      'KernelFunction','rbf','BoxConstraint',exp(z(2)),...
      'KernelScale',exp(z(1))));
  opts = optimset('TolX',5e-4,'TolFun',5e-4);
  [searchmin fval] = fminsearch(minfn,randn(2,1),opts)
  </code></pre>
  
  <p>The minimization is over two parameters.</p>
  
  <p>Now I would like to minimize a third parameter, but this parameter can only take positive integer values, i.e. 1,2,3,...</p>
  
  <p>How can I tell fminsearch to only consider positive integers?</p>
  
  <p>Second, if my third parameter gets initialized to 10 but it actual best value is 100, does fminsearch converge fast in such cases?</p>