how to write *normrnd* by myself?

I want to write normrnd 's code by myself but I have no idea about it. thanks for help

 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

@Matt J: I think you mean
x = randn(m,n);
Yep, thanks Roger.
thanks ,excuse me can I write randn 's code just by using rand too?
I can't see how you would do that, except by using a Central Limit Theorem approximation.
thanks a million

Sign in to comment.

More Answers (0)

Categories

Find more on Earth and Planetary Science in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!