U1= 13.5; U2= 9;dt= 0.01; %time step
MAXT= 0.5;%maximum time (s)
a= 1.2; % threshold
x1(1)=0.5*a;x2(1)=0.5*a;for i= 1:MAXT/dt; x1(i+1) = x1(i) + dt*(U1-U2)+ sqrt(dt)*randn- sqrt(dt)*randn;end
MATLAB: How to repeat this simulation 1000 times
MATLABrepeatsimulation
Best Answer