Concatenating multiple tables in a cell array

16 views (last 30 days)
Hello Everyone, I have a cell array with hundreds of tables in it, It's a 1165x1 cell array. The first 499 are empty cells but the rest have tables in them. from T{500} to T{end}
Most of the tables are 20x153 tables but some of them have different amount of columns (I have identified about 10 out of the 500) which have columns ranging from 130 to 157 columns. Is there a way I could concatenate vertically all the tables in the cell array with 20x153 dimensions ignoring these outliers?
Thank you.
  2 Comments
Daniel Abraham
Daniel Abraham on 19 Jul 2021
Well I was actually looking for an easy way out haha,I think I’d prefer the second option if it’s possible.

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 19 Jul 2021
mask = cellfun(@(c) size(c,2) == 153, T);
Tfull = vertcat(T{mask});
  8 Comments
Daniel Abraham
Daniel Abraham on 27 Jul 2021
I see, thanks a lot, I appreciate your suggestions

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by