p = 0.5; thresh = 50.0; hold on for k = 1:30 x = randomwalkthresh(p, thresh); plot(x) end hold off