N=20; f=0.1; answer="" ; for n=1:N outcome = ( rand(1,1) < f ) ; answer = sprintf( "%s%d", answer, outcome ) ; endfor getnewline = input(answer);