reading a table: column name

I created a csv file
morning afternoon
1 0
0 2
I read it using readtable
and then type
morning
then I got
unrecognized function or variable
Please advise.

6 Comments

a =readtable('test.csv')
morning = a.morning
Isn’t that correct?
Yes this is the correct one.
Post it as an answer
Answer this question

Sign in to comment.

 Accepted Answer

Suraj Sudheer Menon
Suraj Sudheer Menon on 14 Jun 2020
A column can be read from a table by referring to the the column variable.
data=readtable('filename.csv')
morning=data.morning;

More Answers (0)

Categories

Products

Tags

Community Treasure Hunt

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

Start Hunting!