Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

MATLAB help for modelling with changing variables.

  1. May 31, 2012 #1

    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

    (Equations found in CaMito2_p)

    Can anyone help me out? Thanks!!!
  2. jcsd
  3. Jun 1, 2012 #2
    don't know matlab or ode23s, but...

    do you solve with initial conditions?
    can you solve your problem in two parts? [0,10] and [10,375] ? and use the solution from the first part as the initial condition for the second part? and in the middle, set to zero the one variable that you are talking about?
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Threads - MATLAB help modelling Date
Matlab MATLab: Not enough inputs for nlinfit Nov 16, 2017
Matlab Help needed to fix a matlab code Nov 8, 2017
New to Matlab, help with vectors Feb 20, 2016
Need help with integral Dec 23, 2015
Help me solving this Biofilter model in matlab Sep 14, 2005