Thread Subject: Random Integer generator - simulink

Subject: Random Integer generator - simulink

From: Ashwini Deshpande

Date: 11 Nov, 2009 11:26:04

Message: 1 of 3

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

Subject: Random Integer generator - simulink

From: Amanda Galtman

Date: 11 Nov, 2009 22:14:40

Message: 2 of 3


"Ashwini Deshpande" <vd.ashwini@mathworks.com> wrote in message
news:hde70c$aq1$1@fred.mathworks.com...
> 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
>

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

Subject: Random Integer generator - simulink

From: Ashwini Deshpande

Date: 12 Nov, 2009 06:33:01

Message: 3 of 3

"Amanda Galtman" <agaltman@mathworks.com> wrote in message <hdfd0g$1eg$1@fred.mathworks.com>...
>
> "Ashwini Deshpande" <vd.ashwini@mathworks.com> wrote in message
> news:hde70c$aq1$1@fred.mathworks.com...
> > 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
> >
>
> 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
>
Thanks a lot,
It works ..
-- Ashwini

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
integer Ashwini 11 Nov, 2009 06:29:04
random Ashwini 11 Nov, 2009 06:29:03
rssFeed for this Thread

Contact us at files@mathworks.com