I'm sorry, this is the right method. As all the data of my first row are '0', so the converted array look like a string of 0. After changing the data type, I can get the vector of num.
How to convert one row of a table to a vector?
32 views (last 30 days)
Show older comments
Now I have a table and I want to convert one row to a vector. I firstly used table2array, then cell2mat. However the result is a string rather than a vector. As shown in the picture. How can I complete the transformation? Thanks!

0 Comments
Accepted Answer
Yujian Wu
on 13 Jan 2018
2 Comments
per isakson
on 13 Jan 2018
Edited: per isakson
on 13 Jan 2018
What "this is the right method" ?
tbl = array2table( magic(5) );
row = tbl{ 2, : }
returns
row =
23 5 7 14 16
More Answers (0)
See Also
Categories
Find more on Data Type Conversion 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!