I need ziggurat matlab code to draw
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello, i need a ziggurat matlab code to generate somehing like this
i'm working with (gauss) random number generator ziggurat rejection method
0 commentaires
Réponse acceptée
Chunru
le 17 Mai 2022
Modifié(e) : Chunru
le 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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Random Number Generation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!