【发布时间】:2017-01-25 13:09:45
【问题描述】:
考虑A 和m by n 矩阵。我想通过随机选择NumOfRandomColumn 列来明智地拆分A 列。
我已使用此代码生成随机索引向量并提取第一个部分:
indexes=randsample(1:MatrixColumnNumber, NumOfRandomColumn);
firstSection=A(:,indexes);
如何提取第二部分,即不在'indexes'中的索引?
这不起作用:
secondSection=A(:,~indexes);
【问题讨论】: