Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Random Integer generator - simulink

137 views
Skip to first unread message

Ashwini Deshpande

unread,
Nov 11, 2009, 6:26:04 AM11/11/09
to
Hi,

How do i generate random numbers between given limits in simulink. For ex: between 25 - 30. At every sample time one of the value between 25 to 30 should be given out. (could be25, 26 , 30, 28, 25, 29, etc.,)

Thanks,
Ashwini

Amanda Galtman

unread,
Nov 11, 2009, 5:14:40 PM11/11/09
to

"Ashwini Deshpande" <vd.as...@mathworks.com> wrote in message
news:hde70c$aq1$1...@fred.mathworks.com...

Hi Ashwini,

If you wanted a uniform distribution and you have the Communications Blockset
product, then you can use the Random Integer Generator block to generate
integers between 0 and 5 (so M-ary number = 6). Then use a Bias block to add 25
to the result.
http://www.mathworks.com/access/helpdesk/help/toolbox/commblks/ref/randomintegergenerator.html
http://www.mathworks.com/access/helpdesk/help/toolbox/simulink/slref/bias.html

HTH,
Amanda


Ashwini Deshpande

unread,
Nov 12, 2009, 1:33:01 AM11/12/09
to
"Amanda Galtman" <agal...@mathworks.com> wrote in message <hdfd0g$1eg$1...@fred.mathworks.com>...
Thanks a lot,
It works ..
-- Ashwini
0 new messages