如何生成行数多于列的随机矩阵?例如,对于行数为列数的整数倍,如10 columns 500 rows,或20 columns 1000 rows等...
gno*_*ice 12
nCols = randi([10 20]); %# A random integer between 10 and 20
nRows = nCols*50; %# Number of rows is a multiple of number of columns
mat = rand(nRows,nCols); %# A matrix of random values between 0 and 1
Run Code Online (Sandbox Code Playgroud)