xlsread doesn't read a column that contains string in the cells with unknown number of rows
Show older comments
Hi all
I am trying to read from an xlsx Excel file some rows in clumn 1 that are strings.
xlsread alone does not function
how to read all and put into a list ?
9 Comments
Bob Thompson
on 20 Jun 2019
Are you using all of the outputs for xlsread?
[numdata,textdata,all] = xlsread('mydata.xlsx');
farzad
on 20 Jun 2019
Bob Thompson
on 20 Jun 2019
When you call the reference, use all{1}, instead of all(1). With cells (the curly braces), calling regular parentheses calls the cell itself, but if you use curly braces then it calls the contents of the cell.
farzad
on 20 Jun 2019
farzad
on 20 Jun 2019
Bob Thompson
on 20 Jun 2019
What is the purpose of using square brackets? Are you trying to create a string that is entirely '[file.xlsx]'?
farzad
on 20 Jun 2019
Bob Thompson
on 20 Jun 2019
A conversion to what? What are you looking to do with it? all(1) is a cell class element, but all{1} is a string class, which can be used as an input for other commands, such as a file reading function.
farzad
on 20 Jun 2019
Accepted Answer
More Answers (0)
Categories
Find more on Text Files in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!