Extract overlapped rows from two excel files

1 回表示 (過去 30 日間)
Cassie
Cassie 2011 年 4 月 12 日
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,:)
  1 件のコメント
Cassie
Cassie 2011 年 4 月 12 日
Hey,
It is working great and thank you very much. :)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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