% continuous controller function pol=contin(cp,m,fil) ul=-5; % lower bound of u uu=5; % upper bound of u ur=uu-ul; cop(:)=cp(fil,:); rn=rand; pom=0; for f=1:m if (pomrn) uop=ul+pom*ur; pol=uop; end pom=pom+cop(f); end