Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: matrix generation of random numbers
Replies: 8   Last Post: Jan 17, 2014 5:32 PM

 Messages: [ Previous | Next ]
 Narayanan Posts: 14 Registered: 6/10/13
Re: matrix generation of random numbers
Posted: Jan 17, 2014 4:36 AM

TideMan <mulgor@gmail.com> wrote in message <10d5216b-449c-46e3-b512-56c319591c9f@googlegroups.com>...
> On Friday, January 17, 2014 8:17:14 PM UTC+13, Narayanan wrote:
> > I need to generate a matrix of size 3*20. It should contain random numbers from 0.5 to 10 rounded off to values of 0.25. example numbers acceptable are 0.75, 6.25,8.5,4.0 and not values like 1.2, 2.36, 5.4, 8.19. Kindly hep me in this regard.
>
> So, show us what you've tried and where you got stuck, then maybe we can help.
> Did you read:
> help rand
> ?
> It has an example of how to generate numbers between a and b.
> And:
> help round
> will also be helpful.

I have used
B = randi([50,1000],3,20). It is generating a matrix of 3*20 with values between 50 and 1000. But if I change it to
B = randi([0.5,10],3,10) I get an error as "IMIN and IMAX must be integer values".

Date Subject Author
1/17/14 Narayanan
1/17/14 Derek Goring
1/17/14 Narayanan
1/17/14 Nasser Abbasi
1/17/14 Steven Lord
1/17/14 Derek Goring
1/17/14 James Tursa
1/17/14 Derek Goring
1/17/14 John D'Errico