Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Finding the indices of the elements of one array in another one with multiple repating
조회 수: 1 (최근 30일)
이전 댓글 표시
i need to find contents of rxn in file1 and when the contents were the same, the contents of dor with the same indices with file1 would be copied to a new file, file1 and dor are two columns of an excel file, the problem is that some of arrays of rxn are repeated multiple times in file1 and for each of them there is a different contents in dor, i run the following function but it copies all of dor contents in one cell, for example 1.2.3.3 is a content of file1 and is repeated 4 times and there are 4 different contents in dor, for example:
asis
sudd
sjuh
kijh
i'm going to create a new file with this shape: 1.2.3.3 asis
1.2.3.3 sudd
1.2.3.3 sjuh
1.2.3.3 kijh
but here is what i gained: 1.2.3.3 asissuddsjuhkih what is the problem by my code? here is my code:
x={};
for i=1:numel(file1)
f=find(ismember(file1,rxn(i)));
z=dor(f);
z=z'
s=cell2mat(z);
x(i)={s};
end
댓글 수: 0
답변 (0개)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!