MATLAB Answers

how to write *normrnd* by myself?

3 views (last 30 days)
I want to write normrnd 's code by myself but I have no idea about it. thanks for help

  0 Comments

Sign in to comment.

Accepted Answer

Matt J
Matt J on 16 Feb 2016
Edited: Matt J on 16 Feb 2016
Just use
x=randn(m,n);
y=A*x+B;
and choose A and B appropriate to the sigma, mu that you want.

  5 Comments

Show 2 older comments
alireza kooshafar
alireza kooshafar on 16 Feb 2016
thanks ,excuse me can I write randn 's code just by using rand too?
Matt J
Matt J on 16 Feb 2016
I can't see how you would do that, except by using a Central Limit Theorem approximation.

Sign in to comment.

More Answers (0)

Categories

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by