Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Finding the indices of the elements of one array in another one with multiple repating

1 回表示 (過去 30 日間)
babak
babak 2012 年 11 月 5 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by