Matlab 矩阵拼接和随机取列、取行
A = [1,2,3; 4,5,6; 7,8,9; 10,11,12]B = [0,1,2];% ; 表示纵向拼接,B在A的下面。横向拼接为 : C = [A; B]s = size(A);data_sum = s(1); % 取的比例addPercentage = 0.5;addNum = round(data_sum * addPercentage)% 取列selected = A(:,randperm(s(2),addNum))% 取行.