I have a A={[1,2,4],[2,3,7],[2,5],[4,5,6]} and B=[1;2;3;6;8]
I want to write a code that find B inside A.
the result should be c={[1,2],[2,3],[2],[6]}.
I try this code
c=cell(1, size(A,2));for i=1:size(A,2) current=A{i}; for j=1:size(B,1) index_X = find(A{i} == B(j)); if isempty(index_X)==0 c{i}(end+1)=B(index_X); end endend
but it does not work
Best Answer