フィルターのクリア

Info

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

Ismember Bug when compare cellarray

1 回表示 (過去 30 日間)
Avri
Avri 2014 年 5 月 14 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi, I loaded two xml files (4474 and 4495 lines) in order to compare them.
fid1 = fopen('1.xml', 'r');
fid2 = fopen('2.xml', 'r');
lines1 = textscan(fid1,'%s','delimiter','\n');
lines1 = lines1{1};
lines2 = textscan(fid2,'%s','delimiter','\n');
lines2 = lines2{1};
indx = ismember(lines1,lines2);
There are few lines that aren't equal but ismember return 1.
Why does it happened? if needed I can sent the files
  1 件のコメント
dpb
dpb 2014 年 5 月 14 日
Probably owing to the data -- you've converted to character arrays and didn't use 'rows' option. What if just use the cells as read?
Paste a short segment of data that shows the problem; we don't need 5000 lines when 5 or so will do.

回答 (1 件)

the cyclist
the cyclist 2014 年 5 月 14 日
The ismember() command doesn't check for equality. Perhaps you want to use the isequal() command?

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by