Extract overlapped rows from two excel files
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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,
0 Kommentare
Akzeptierte Antwort
Oleg Komarov
am 12 Apr. 2011
[data1, text1] = xlsread(xls1);
[data2, text2] = xlsread(xls2);
[text,pos] = intersect(text1,text2);
data1(pos,:)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Data Import from MATLAB finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!