%Driver for banditE Ravg=zeros(1000,1); E=0.1; for j=1:2000 m=randn(10,1); [As,Q,R]=banditE(1000,m,E); Ravg=Ravg+R; if mod(j,10)==0 fprintf('On iterate %d\n',j); end end Ravg=Ravg./2000; %TO PLOT A SINGLE RUN: plot(Ravg); %WHEN DOING MULTIPLE RUNS (BY CHANGING E), SAVE Ravg AS, FOR EXAMPLE: % Ravg01=Ravg./2000; WHEN E=0 % Ravg02=Ravg./2000; WHEN E=0.01 % Ravg03=Ravg./2000; WHEN E=0.1 %After these three runs, plot them by using the command % (you can type this into the command window "live") % % plot(1:1000, Ravg01, 1:1000, Ravg02, 1:1000, Ravg03);