%% Random Numbers Within Specified Interval
% Generate a 10-by-1 column vector of uniformly distributed numbers in the interval (-5,5).

r = -5 + (5+5)*rand(10,1)

% In general, you can generate N random numbers in the interval (a,b) with the formula r = a + (b-a).*rand(N,1).
% Copyright 2012 The MathWorks, Inc.