% generating of control actions function pol=mcontin1(mp,m,Ulower,Uupper) ul=Ulower; % lower bound of u uu=Uupper; % upper bound of u ur=(uu-ul)/m; %pol=ul*mp(1)+uu*mp(m); pol=0; for i=1:m pol=pol+mp(i)*(ul+ur/2+(i-1)*ur); end