How to concatenate cells in mat file under each other?

1 次查看(过去 30 天)
Hello, I have a .mat file which is comprised of 255 cells. Each cell is a 14 by 65 table. I need to concatenate the tables under each other so that I can have a 14*225 by 65 table at the end. Does anyone know how I can do so in Matlab?

采纳的回答

Stephen23
Stephen23 2020-8-11
编辑:Stephen23 2020-8-11
Your question is unclear: does the mat file contain one cell array of 255 elements, or 255 separate scalar cell arrays?
If there are 255 separate scalar cell arrays and no other data in the file:
D = 'absolute/relative path to where the file is saved';
F = 'the filename.mat';
S = load(fullfile(D,F));
C = structcell(S);
T = vertcat(C{:});
If there is only one cell array of 255 elements and no other data in the file, replace struct2cell with:
C = S.nameOfTheField;

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Cell Arrays 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by