Random Numbers Help Required

Status
Not open for further replies.

mashar786

Newbie level 3
Joined
Jul 14, 2009
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Pakistan
Visit site
Activity points
1,303
Hi

I want to create a random matrix say of size 3x3. By the help of rand command i am getting a matrix like

A=[ 1.xxxx 2.xxxx 3.xxxx ; 4.xxxx 5.xxxx and so on]

But the thing i required is the matrix of size 3x3 randomly created such that it should have all the elements from 1 to 9.

I tried round(rand(rows,columns)), but here problem i am getting is that some numbers are repeated also eg 3.2323 and 3.9494 both are rounded to 4, which i dont require. My requirement is to recieve unique whole number matrix consisting of elements 1 to m*n.
 

Mods, I request you to remove such postings....

mashar786, please refrain yourself from spamming..... there are other sections for your queries...
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…