MATLAB Answers

Extracting character from an excel file

30 views (last 30 days)
pradeep kumar
pradeep kumar on 28 Sep 2014
Commented: pradeep kumar on 28 Sep 2014
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

Accepted Answer

Guillaume on 28 Sep 2014
The simplest way, would probably be to use readtable and get your data as a table:
t = readtable('data.xlsx');
pradeep kumar
pradeep kumar on 28 Sep 2014
i have used xlsread(data.xlsx) , but its only extracting the numerical values ,but i want to obtain both as mentioned above . Please help me out

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!