Filter löschen
Filter löschen

Concatenating multiple tables in a cell array

21 Ansichten (letzte 30 Tage)
Daniel Abraham
Daniel Abraham am 19 Jul. 2021
Kommentiert: Daniel Abraham am 27 Jul. 2021
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 Kommentare
Walter Roberson
Walter Roberson am 19 Jul. 2021
The entries that have fewer than 153 columns: you want to ignore those entries completely, right?
The entries that have more than 153 columns: do you want to ignore those entries completely, or do you want the first 153 columns of them to be used?
Daniel Abraham
Daniel Abraham am 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.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 19 Jul. 2021
mask = cellfun(@(c) size(c,2) == 153, T);
Tfull = vertcat(T{mask});
  8 Kommentare
Walter Roberson
Walter Roberson am 27 Jul. 2021
That code does not download from OneDrive to local disk, but if possible you would really rather read from local disk than from OneDrive. The performance loss for reading from OneDrive can be substantial. Even just starting by copying the files to local drive can improve performance a lot.
Daniel Abraham
Daniel Abraham am 27 Jul. 2021
I see, thanks a lot, I appreciate your suggestions

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Cell Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by