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

  1. May 2, 2012 #1
    I made an epidemics SIR model but want to vary one of the parameters but it's not working can someone help I pasted the code below I believe the parameter I want to change, v, is not updating:


    v_range=linspace(0,.1,1000);
    numinfected=0*v_range;

    for vi=1:1000;


    for klok=1:100000;
    t=klok*dt;
    S_to_I=dt*S*I*a;
    I_to_R=dt*b*I;
    nu=v_range(vi);
    S_to_V=dt*nu*S;
    I_to_Q=dt*I*q;
    Q_to_R=dt*Q*r;

    S=S-S_to_I-S_to_V;
    I=I+S_to_I-I_to_R-I_to_Q;
    R=R+I_to_R+Q_to_R;
    V=V+S_to_V;

    %store data...
     
  2. jcsd
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted



Similar Discussions: MATLAB help
  1. Matlab Help (Replies: 0)

  2. MATLAB help (Replies: 9)

  3. MATLAB help (Replies: 2)

  4. MATLAB help (Replies: 7)

  5. Matlab help (Replies: 6)

Loading...