% Run_warfarin clear all clc rep=1000; %% independent variables d=3.5; dn_total=150; crit=2; crit2=3.5; TTR_success=0.55; perf_adh=0; % perf_adh=1 is perfect adherence % perf_adh=0 is imperfect adherence %% START MODEL -------------------------- options = odeset('RelTol',1e-6); for ii=1:rep; ii inits = [d 1 1 1 1 1 1]; start=1; time_dose=0; init_PKPD_param KDE=cl_s(ii)/v_s(ii); EDK50=cl_s(ii)*EC50(ii); if perf_adh==1 init_profilegenerator_perfect profile_generator_perfect else init_profilegenerator profile_generator end for jj=1:dn_taken D=[d 0 0 0 0 0 0]; if jj==1; di=(dt2(1,1)); else di=(dt2(1,jj)-dt2(1,jj-1)); if dt2(1,jj)