how to read a column named by some header in excel by using matlab?

5 ビュー (過去 30 日間)
Ravikant Singh
Ravikant Singh 2014 年 3 月 5 日
I am having 18 to 20 columns named with different headers in n number of excel files like AOA CAS IAS ALT etc. sometimes the order of the column is changed and makes my work difficult so i want a program which will look for the column by its name like AOA and saves the data in a variable and if column is not there in the file then it will tell the user that its not available.

採用された回答

Chandrasekhar
Chandrasekhar 2014 年 3 月 5 日
strings = {'AOA','CAS','IAS','ALT'};
[header,data] = xlsread('myxls.xls','Sheet','Range');
idx = find(strcmp(header,'AOA'));
AOA = data(:,idx);
eval(['save ' char(strings(1)) '.mat ' 'AOA'])

その他の回答 (1 件)

Ravikant Singh
Ravikant Singh 2014 年 3 月 7 日
thnx

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by