hi Mit, u can use the following command: ones(size(A))*diag(min(A)) + rand(size(A))*diag((max(A) - min(A))) in the second term the "diag((max(A) - min(A)))" scales each column separately according to the required range. In the first term "diag(min(A))" adds the required bias. To use the same for rows use premultiplication instead of post-mult. -priyank --- wrote: > Hi > > Given that I have a matrix, say A = [1 2 3; 4 5 6], > how do I draw new samples over the range of A columns using uniform > distribution? > > For example, min(:,1) = 1 and max(:,1) = 4 > Therefore my new sample can have data points ranging from 1 to 4 in > the first column, and so on. I know I can use rand to draw random > numbers that is uniformly distributed, but I do not know how to set a > range for each column of the matrix. > > I would really appreciate any help given. Thank you very much in > advance. > > Sincerely > Mit > > __________________________________________________ |