MATLAB: Generate random negative numbers

random number generator

I thank if some one can help in this, how can i generate a matrix of some size for ex 100×100 with in the range of [-0.01,0] and that too with decimal values contained in it like -0.001,-0.0056 like that and also for the ranges like [-60,-30] with decimal values like -58.254,-56.985 and only 3 decimal values after the point.

Best Answer

n=3; %number of decimal places
A = randi([-60,-30]*10^n,[100,100])/10^n;