【发布时间】:2016-02-15 22:07:30
【问题描述】:
我必须生成 20 个大小不断增加的随机矩阵
200:50:1150 //sizes of 20 random matrices
我想将它们存储在矩阵数组中:
喜欢
array(1) // should give me the 1st matrix of size 200x200
array(2) // should give me the 2nd matrix of size 250x250 and so on
我不知道该怎么做:
n = 200:50:1150
for i=1:20
M(:,:,i) = rand(n(i)); //This does not work
end
我该怎么做,有没有没有循环的更快方法?
【问题讨论】:
-
代码示例不工作。请修复它或描述您期望的输出。
-
这里我编辑了问题