MATLAB: Random pulse generator

random pulse generator

Hello,
I'm new in Simulink and i trying to make a pulse random generator. Pulses have amplitude (+10 & -10) and width (1 ms). The signal has to be non periodic, i mean, pulses has to appear by a random series. how can i do it? I apprecitate any help. The begining of my project depend of this signal.
Thanks. Néstor.

Best Answer

use this block
the function is
function y = fcn(u)
%#codegen
id=rand(1)
if id>0.5 & u==0
y=1
else
y=0
end
or easier
%