How to compare two excels for matches and differences row by row in Matlab?

19 ビュー (過去 30 日間)
Yera Yera
Yera Yera 2020 年 3 月 11 日
回答済み: Guillaume 2020 年 3 月 11 日
In first excel, i have a spreadsheet(100x100). In second one, i have a spreadsheet which is only 1 row x 100 colums. I would like to compare second excel file with first excel for matches row by row. I need to know which row from first excel matches with row from second excel. Thank you

回答 (1 件)

Guillaume
Guillaume 2020 年 3 月 11 日
allrows = readmatrix('your1stexcelfile'); %readmatrix requires R2019a or later
singlerow = readmatrix('your2ndexcelfile');
isthesinglerow = ismember(allrows, singlerow, 'rows');
isthesinglerow will be a logical array where a 1 indicates that the corresponding row of allrows matches singlerow. If you want the index of these rows use find(isthesinglerow).

カテゴリ

Help Center および File ExchangeData Import from MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by