www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/RandomIntegersWithinSpecifiedIntervalExample.m

    %% Random Integers Within Specified Interval  

%% 
% Generate a 10-by-1 column vector of uniformly distributed random integers
% from the sample interval |[-5,5]|. 
r = randi([-5,5],10,1)