MATLAB: How to Generate a matrix of random non-integers??

matrixnon-integersrandom

Hi There, I need to Generate a 5×7 matrix of random non-integer numbers, each within the range from 0 to 25! I've tried thiss: "rand_mat = randi((0:25), 5, 7)*rand" and it gives me a nice matrix but apparantly it's not the "right" way of doing it!
Does anyone here have a suggestion/advise for me? xxx

Best Answer

Randi generates INTEGERS. You state that you want NON-integers,so real numbers? What does rand do? read the help for these things. That is how you will learn.
Rand generates numbers in the interval [0,1].
Suppose you were to generate such a matrix of the desired shape using rand. Now, suppose you multiplied each of them by 25? Would they have the desired property?