title: Matlab :Model fitting and optimization error
body: <p>I have a defined values of input (time samples) output (concentration), I would like to fit a model in order to estimate the Parameter values of rate constants(here in this case rate constants were defined as K1 K2 K3)</p>
  
  <p>I have used lsqcurvefit for optimization but i am incurring errors in my usage of lsqcurvefit solver</p>
  
  <p>First the values of x variable(t) and y variable(c_tot)</p>
  
  <pre><code>c_tot =[0,0,0,396.979609003375,503.769614648079,285.408414510699,137.309948090421,...
          63.0089145454838,28.2076980338446,12.4169874862731,5.39698687726493,...
          2.32247111168307,0.971427824475975,0.396298705702665,0.154518313562792,...
          0.0563350826881436,0.0175309433420762,
           0.00589400762862266,0.00199918527022414];%Loading Sampled Mat file values for fitting the Estimates of K in it
  
  
  
  t=[0 0.25 0.5 0.75 1 1.5 2 3 4 9 13 18 23 28 33 38 43 48 53];%time samples
  </code></pre>
  
  <p>now the model which needs to be fitted</p>
  
  <pre><code>%-----------Model to be fitted-------------------------------------
  k1_r=0.014;%reference tissue rate constant
  
  a1=17501;a2=28500;a3=65000;%Values of a1 a2 a3 of Arterial input function
  
  b1=0.9;b2=0.2;b3=0.5;%Values of b1 b2 b3 of Arterial Input Function 
  
  td=0.3% Indicates delay time
  
  tmax=0.8% maximum peak time concentration
  
  A = ((K(1)*K(2))/(k1_r*(K(2)+K(3))));
  B = ((K(1)*K(3))/(k1_r*(K(2)+K(3))));
  
  model=@(K,t)conv((a1 * exp(-b1 * (t - tmax))+...
                 a2 * exp(-b2 * (t - tmax))) +...
                 a3 * exp(-b3 * (t - tmax)),...
                 (A*exp(-(K(2)+K(3))*t+B)),'same');
  </code></pre>
  
  <p>Now i have used initial estimates of the parameters(k1 k2 k3) which i would like to fit 
  and called the solver  </p>
  
  <pre><code>%----------------Assignment------------------------------------------------
  K=[0.1 0.08 0.4];%  Initial estimates of K1 K2 K3
  
  %----------------Least-square curvefitting---------------------------------
  
  K_est=lsqcurvefit(model,K,t,c_tot);
  
  plot(K_est,'o');
  
  
  xlabel('Time(mins)');
  ylabel('Concentration(Bq/ml)');
  </code></pre>
  
  <p>Following is the error that i am incurring </p>
  
  <pre><code>    Undefined function 'tomlablic' for input arguments of type 'double'.
  
  Error in tomlabVersion (line 45)
  [x1,x2,x3,x4,x5,x6,tomV,OS]=tomlablic(1);
  
  Error in GetSolver (line 72)
  [TomV,os,TV] = tomlabVersion;
  
  Error in lsqnonlin (line 415)
     Solver = GetSolver(checkType([],Prob.probType),...
  
  Error in lsqcurvefit (line 298)
  [x, f_k, r_k, ExitFlag, Output, Lambda, J_k, Result] =...
  </code></pre>
  
  <p>I am not experienced enough to know what I could do in order to perform model fitting.</p>
  
  <p>Does any other solver will help me in this or is there any Global optimization tool box with which i can fit in initialized values </p>
  
  <p>Any tips are welcome...</p>