Info
Questa domanda è chiusa. Riaprila per modificarla o per rispondere.
how to merge 2 excel files to get different values as result
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
i need to merge 2 excel files which are having different values. if their any existence of similar values. the results has to get display.
1 Commento
Jan
il 11 Ago 2017
Please post more details. Currently it is not possible to answer this. Do you really mean Excel files? Or are you able to import the data alreadfy to Matlab?
Risposte (1)
Ahmed raafat
il 11 Ago 2017
Modificato: Ahmed raafat
il 11 Ago 2017
simple method is to read and save the two excels in 2 variables
x1=xlsread('Sheet1.xls');
x2=xlsread('sheet2.xls');
if size(x1,1)==size(x2,1) % check if thy have same rows
if size(x1,2)==size(x2,2) % check if they have same coulmns
z=x1-x2;
r=find(z==0); % find values that equals zero
zx=z(r); % choose them
disp(z) % display them
end
end
or if size of x1 and x2 not equal
same_values=[];
for i=1:size(x1,1)
for j=1:size(x2,2);
r=find(x2==x1(i,j));
if length(r)>0
same_values(end+1)=x1(i,j);
end
end
end
disp(same_values)
0 Commenti
Questa domanda è chiusa.
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!