TideMan <firstname.lastname@example.org> wrote in message <email@example.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".