Page 399 - Control Theory in Biomedical Engineering
P. 399

Appendices for Chapter 2  365


                    for i=2:n
                        m0=[m(end,1) m(end,2)];
                        k=parameter(1,i);
                        k12=parameter(2,i);
                        k21=parameter(3,i);
                        mdiet=parameter(4,i);
                        min=parameter(5,i);
                        mout=parameter(6,i);
                        mtis=parameter(7,i);
                        [t,m]=ode45(@equations, [t0, tmax(i)], m0);
                        schift=schift+tmax(i-1);
                        plot(t+schift,m(:,2)/v2, 'linewidth',2,'color','r')
                        m2max=[m2max,m(end,2)];
                        axis([0, sum(tmax),170,(max(m2max)/v2)+10])
                 end
              end
   394   395   396   397   398   399   400   401   402   403   404