MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi
Learn moreOpportunities for recent engineering grads.
Apply TodayMATLAB Central > MATLAB Newsreader > Selecting randomly a number from a matrix within a... 

Subject: Selecting randomly a number from a matrix within a given range From: Diego Zegarra Date: 20 Oct, 2008 04:31:24 Message: 1 of 8 
Alright I have a problem selecting randomly a number that is within a range. I have m matrices of nxn as MTT{m},and if we look at the min value of the diagonals it is 52 and the max value is 97. So now I want to select randomly a number from the diagonals that is within 52 and 52 + (9752)*0.4 = 70. This means that in the first matrix MTT{1} I can select from 52,59 and 65. Now in the second matrix we would have 63 and 57. 
Subject: Selecting randomly a number from a matrix within a given range From: Walter Roberson Date: 20 Oct, 2008 05:35:32 Message: 2 of 8 
Diego Zegarra wrote: 
Subject: Selecting randomly a number from a matrix within a given range From: Diego Zegarra Date: 20 Oct, 2008 14:10:03 Message: 3 of 8 
Walter thanks for your reply but it does not seem to be working. It throws me this error message. Could anyone help me with this?? 
Subject: Selecting randomly a number from a matrix within a given range From: Diego Zegarra Date: 20 Oct, 2008 14:28:03 Message: 4 of 8 
Ok nevermind with my last post as I fixed that already. I had to change the code to be, 
Subject: Selecting randomly a number from a matrix within a given range From: Diego Zegarra Date: 20 Oct, 2008 17:40:18 Message: 5 of 8 
Could anyone please help me with this? Any hints on how I can do this? I need it soon! Thanks 
Subject: Selecting randomly a number from a matrix within a given range From: dpb Date: 20 Oct, 2008 17:42:42 Message: 6 of 8 
Diego Zegarra wrote: 
Subject: Selecting randomly a number from a matrix within a given range From: Diego Zegarra Date: 20 Oct, 2008 18:46:02 Message: 7 of 8 
That it gives me the indexes for the values that satisfy but I dont know from what machine those indexes are or the indexes of that value selected within that machine. 
Subject: Selecting randomly a number from a matrix within a given range From: Walter Roberson Date: 20 Oct, 2008 19:48:21 Message: 8 of 8 
Diego Zegarra wrote: 
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.