Hi,(adsbygoogle = window.adsbygoogle || []).push({});

I'm new to MATLAB and programming, but I hoping to find out if I can have a variables in my program take on certain values only for certain time intervals. For example, I am using ode23s to solve some equations for me, but for the time interval [0,10] I would like one of the variables from the equations to be 10, but from [10, 375] the variable should be 0.

function CaMito2_p1

[t,x]=ode23s('CaMito2_p',[0,375],[500e-9,0.9e-6]);

plot(t,x(:,1))

end

(Equations found in CaMito2_p)

Can anyone help me out? Thanks!!!

**Physics Forums | Science Articles, Homework Help, Discussion**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# MATLAB help for modelling with changing variables.

**Physics Forums | Science Articles, Homework Help, Discussion**