Extract overlapped rows from two excel files

1 次查看(过去 30 天)
Hey all, I am a newbie for Matlab and sorry for the silly questions. Assume there are two excel files,excel1 and excel2. Excel1 contains students names and their scores for English and Math such as row1=(John,98.5,74.5),row2=(Cassie,68.53,74,8)row3=(Bob,95.23,82.65)..etc. Excel 2 which contains only a few students' names such as only John and Bob. Is there any way to extract rows of John and Bob and save their scores in a matrix ? So the final matrix should be A(1,1)=98.5 A(1,2)=74.5, A(2,1)=95.23 and A(2,2)=82.65. Thank you very much,

采纳的回答

Oleg Komarov
Oleg Komarov 2011-4-12
[data1, text1] = xlsread(xls1);
[data2, text2] = xlsread(xls2);
[text,pos] = intersect(text1,text2);
data1(pos,:)

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by