I need ziggurat matlab code to draw
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Mar One
el 17 de Mayo de 2022
Comentada: Mar One
el 17 de Mayo de 2022
Hello, i need a ziggurat matlab code to generate somehing like this
i'm working with (gauss) random number generator ziggurat rejection method
0 comentarios
Respuesta aceptada
Chunru
el 17 de Mayo de 2022
Editada: Chunru
el 17 de Mayo de 2022
where is a normalizing constant that we can ignore.
x = [0:.1:2]
y = 1/(2*pi)*exp(-x.^2/2);
stairs(x, y, 'b');
hold on
xl = xlim;
plot([xl(1)*ones(1, length(x)-1); x(2:end)], [y(2:end); y(2:end)], 'b')
% longer tais
x = [0:.1:4]
y = 1/(2*pi)*exp(-x.^2/2);
plot(x, y, 'r')
8 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Random Number Generation en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!