I need ziggurat matlab code to draw
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello, i need a ziggurat matlab code to generate somehing like this
i'm working with (gauss) random number generator ziggurat rejection method
0 Kommentare
Akzeptierte Antwort
Chunru
am 17 Mai 2022
Bearbeitet: Chunru
am 17 Mai 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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Random Number Generation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!