function U=scelta(X,Y) % given a matrix X and a column Y the program gives a matrix whose rows are all the rows obtained % taking a row r of X and adding to it an element e of Y if e is not element of r U=zeros(0,size(X,2)+1); for i=1:size(X,1) for j=1:size(Y,1) if ismember(Y(j,1),X(i,:))==0 U=[U; [X(i,:),Y(j,1)]]; end end end