finding the same arrays with different indices

조회 수: 1 (최근 30일)
babak
babak 2012년 11월 5일
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개)

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by