I need to choose from the database randomly 20% of the values (lines) in the class "1", transfer them to another matrix, and delete them from the past .. but I can only save and delete one value ... here is the base
M = load('base.txt'); class = 1; set = find(M(:,5)==class); lengClass = length(set); per = round(lengClass*0.2); r = randi([set(1,:), set(lengClass,:)],1,per); for i=1:610 for j=1:per if set(i,:) == r(1:j) Mt(j,:) = M(set(i,:),:); M(set(i,:),:)=[]; end end end