Need to turn table within cell to array
1 view (last 30 days)
Show older comments
So I have a table within a table and would like to turn it into a column vecotor (displaying all individual data), I tried a couple of differetn function but that did not work
0 Comments
Answers (1)
Tushar Behera
on 3 Feb 2023
Hi David,
I believe you have a table which consists of several other tables. You want to convert one of those table into a vector array.
You can use "table2array" function in ordert o acheive the above functionality. For example:
% Define the table within a table
tableInTable = table({table(1:3, 'VariableNames', {'a'}); table(4:6, 'VariableNames', {'b'})},...
'VariableNames', {'NestedTable'});
% Convert the table within a table to a column vector
columnVector = table2array(tableInTable.NestedTable{1})
Hope this answers your query.
Regards,
Tushar
See Also
Categories
Find more on Tables 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!