title: ODE - Solving Parameter Dependent on Variable [Matlab]
body: <p>Lets say I have a function file of the ODE that goes like this</p>
  
  <pre><code>function xprime = RabbitTemp(t,X) 
  
  % Model of Rabbit Population
  % where,
  %       Xo = Initial Population of Rabbits
  %       X(1) = Population density of Rabbit
  %       X(2) = Temperature T (that varies with time) 
  %       a = test parameter
  
  %%% ODE
  a  = 10;
  
  
  dx(1) = (X(1))*(1 - a*X(1) - 3*(X(2))));
  dx(2) = sin(t);
  %%%%%%%
  
  xprime = [dx(1) dx(2)]';
  
  end
  </code></pre>
  
  <p>But what if I would like parameter <strong>a</strong> to vary as temperature <strong>X(2)</strong> varies, as the ODE solver calculates.</p>
  
  <p>I understand I would first have to create some data between <strong>a</strong> and <strong>X(2)</strong> and interpolate it. But after that I'm not very sure what's next. Could any one point me in the right direction? </p>
  
  <p>Or is there any other way?</p>