Hello,
I am seeking to create a loop that simulates the following function, while keeping track of its output. The code i have provided has a boolean output (Response) of either 0 or 1 and I would like to be able to simulate the model described in my code a large number of times while keeping track of the frequency of each boolean output. Any help would be appreciated.
function Response = testingforparam
function C=kinetics(theta,t)
[T,Cv]=ode45(@DifEq,t,c0);
dcdt(1)= 20.*c(3)+(r1).*c(1).*(1-(c(1)/(5*10^9)))-0.02.*c(1)-((69.7).*c(1)/(1+0.01*c(1)));
dcdt(2)= 20.*c(3)+(r2).*c(2).*(1-(c(2)/(1*10^9)))-0.02.*c(2)-((9/11)*(57.02).*c(2)/(1+0.01*c(2)));
dcdt(3)= 0.02.*c(1)+0.02.*c(2)-20.*c(3)-20.*c(3)-39.12.*c(3);
Liver = [0;101329.8755;9983499.7496;3397799162.7540];
Spleen = [0;365778.6821;7088832.4672;169779424.6359];
Blood = [0;23.2338;92.2555;16841.2063];
c = [Liver, Spleen, Blood];
[theta,Rsdnrm,Rsd,ExFlg,OptmInfo,Lmda,Jmat]=lsqcurvefit(@kinetics,theta0,t,c);
tv = linspace(min(t), max(t), 4);
Fit = kinetics(theta, tv);
Final = (LiverFit(end)+SpleenFit(end)+BloodFit(end));