How to delete element from cell arrays after comparisons without causing cell arrays to get empty?
问题 I created 1D array which shows words and in which sentences they occur. After that I took the intersection to show which word occurs with which each of other remaining words in sentence: OccursTogether = cell(length(Out1)); for ii=1:length(Out1) for jj=ii+1:length(Out1) OccursTogether{ii,jj} = intersect(Out1{ii},Out1{jj}); end end celldisp(OccursTogether) the output of above code is as below: OccursTogether{1,1} = 4 11 14 OccursTogether{1,2} = 1 OccursTogether{1,3} = [] OccursTogether{1,4} =