Extracting character from an excel file
2 ビュー (過去 30 日間)
古いコメントを表示
Hello everyone . Suppose i have an excel file (data.xlsx) , which contains the following data.
Name age
Tom 43
Dick 24
Harry 32
Now i want to extract the data from it and make 2 cell array (or matrix) which will contain
name = ['Tom' ; 'Dick';'Harry']
and age = [43;24;32] .
Please help me . how efficiently i obtain this . Thanks in advance
0 件のコメント
採用された回答
Guillaume
2014 年 9 月 28 日
The simplest way, would probably be to use readtable and get your data as a table:
t = readtable('data.xlsx');
2 件のコメント
Image Analyst
2014 年 9 月 28 日
Then, if for some reason you want to break them out separately, do...
name = t.Name;
age = t.age;
I agree this is the best way. You can use tables if you have R2013b or later. If not, (UPGRADE!) then you can use xlsread().
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!