How can I convert this table to a cell array as shown in the screenshot?
Show older comments
I have a CSV file that looks like this
and I would like to convert it to two cell arrays by id.
and I would like to convert it to two cell arrays by id.
One array contains all "t" of the same id (shown above), and the other array contains all "measure" of the same id as shown below
.

Accepted Answer
More Answers (1)
Anmol Dhiman
on 5 Sep 2019
Use the following commands
T = readtable('filename.csv')
c{1} = T{T.id==1,'measure'}
c{2} = T{T.id==2,'measure'}
1 Comment
Categories
Find more on Logical 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!