how can i select a random number from a column of a matrix? and then how to find the location of that number?
7 views (last 30 days)
Iddo Weiner on 1 Apr 2018
If you use a random number to index the row you want to extract, you will already have what you need:
A = randi(10,[4,3]);
rand_row = randi(size(A,1)) %get random row
rand_number = A(rand_row,2) %get your rand number form the 2nd column