comparing two excel files

6 views (last 30 days)
nur iman athilah
nur iman athilah on 8 Mar 2021
Commented: nur iman athilah on 11 Mar 2021
how can i compare two excel file that dont have same row number in order to get the similarity value? My file 'colon.xlsx' have approx 30 rows and another file 'COLONPOLYPS.xlsx' have only one row. I want to compare the colonpolyps file which have only 1 row with all 30 rows in colon file and get the similarities.
  2 Comments
Andy
Andy on 8 Mar 2021
It is best to attach examples of the files and give examples of the similarities. By similarities do you mean identical values in a cell or within a tolerance?
nur iman athilah
nur iman athilah on 8 Mar 2021
I've attach the files here. I want to check the similarities between these two files for the identical values.

Sign in to comment.

Answers (1)

Monisha Nalluru
Monisha Nalluru on 11 Mar 2021
Use readmatrix, readtable, readcell methods to read the data from files
Once the data is present in workspace you can compare using Array Comparsion feature which gives the similar between two matrices i.e 1 when similar and 0 when not similar
As an example
colon=readmatrix('colon.xlsx');
colonpoly=readmatrix('COLONPOLYPS.xlsx');
comparsion=zeros(13,11); % result of comparsion is stored in this variable
for i=2:14 % looping from 2 because first row is heading
comparsion(i,:)= colon(i,:)==colonpoly(2,:);
end
  3 Comments
Steven Lord
Steven Lord on 11 Mar 2021
It's not at all clear to me what you mean by "similarity". I think you understand what you're trying to do, but we aren't familiar with your goal. Please explain starting with the background of your task.
For your first row, for example, the entry with ID 1, with what is it being compared that gives an 80% similarity rate? Is that good or bad? Cinderella's foot being 80% similar to the glass slipper is a good thing. An innocent person's face matching 80% to the face of a wanted person is not so good.
nur iman athilah
nur iman athilah on 11 Mar 2021
im doing a Case-Based Reasoning for XAI colon polyps detection. I want to set the COLONPOLYPS.xslx as the query or new case. Then this new case need to be compared with the all data row by row from the data base which is in the colon.xslx. higher similarity is good. can refer to this link

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!