Extracting values out of a cell array with tables

21 views (last 30 days)
I have a 41x1 cell array with tables including stock returns (find the cell array attached). The tables dimensions vary in number of columns.
I would now like to exctract all the data except column 1:3 from every table into one 1xXXX matrix.
Does anyone have a suggestion for a loop working throug my cell array that returns the described matrix?

Accepted Answer

per isakson
per isakson on 20 Apr 2021
Edited: per isakson on 20 Apr 2021
This script puts all the numerical data into a row vector (column-wise). You didn't say anything about order.
XXX = [];
for jj = 1 : numel( DL12_10T )
tbl = DL12_10T{jj}(:,4:end);
num = table2array( tbl );
XXX = horzcat( XXX, reshape(num,1,[]) );
whos XXX
Name Size Bytes Class Attributes
XXX 1x301836 2414688 double
Fabian Niederreiter
Fabian Niederreiter on 20 Apr 2021
Thanks for the information on the possiblity to surpress the warning. That was totally reasonable for my cause. :)
Thanks again for your time and effort! I appreciate it.

Sign in to comment.

More Answers (0)


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!

Translated by