matlab从多维矩阵中随机选取训练组
A=[1 2;3 4;2 3;4 5;6 2;3 1];%example;[M,N]=size(A); %读取矩阵行列数;num = round(M*(1/3)); % 取A的1/3行作为训练集,round为四舍五入取整;[~,idx]=sort(rand(M,1));%随机排列生成index;B=A(idx(1:num),:);%根据index选取1/3的A集为B集;C=A(idx(num+1:M),:);%保存剩余的数据为C集;...