% simulate two tank system function yt=contro(c,y,t,my) rn=rand; pom=0; for f=1:my if (pomrn) yt=f; end pom=pom+c(f,y(t)); end