xlsread doesn't read a column that contains string in the cells with unknown number of rows

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

Are you using all of the outputs for xlsread?
[numdata,textdata,all] = xlsread('mydata.xlsx');
thank you so much
if I type all(1)
I get one of the names inside
{'file1.xlsx'}
how to remove the {} ?
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.
ah thank you so there is no way to convert them ?
What is the purpose of using square brackets? Are you trying to create a string that is entirely '[file.xlsx]'?
Well not a specific purpose I thought there's always a conversion possibility like other languages like python
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.
Conversion between classes But I think I'm convinced
Thank you so much

Sign in to comment.

 Accepted Answer

You can use readcell, for example,
example = readcell('example.xlsx','Range','A2:P5');
Now you can extract strings from the cell array.
I would recommend you to read:

More Answers (0)

Community Treasure Hunt

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

Start Hunting!