MATLAB: Trying to concentrate a cell containing tables

cellcellsconcentratedataforMATLABstringtable

Hi guys
I have quite a big cell array here with each cell contains a 1×6 table.
I'm trying to take the data out of each cell out to present all of it on one table…
It doesn't let me use the vertcat though because the first column of each one of these tables is of the type "datetime" and I get this message:
% Error using concentrate (line 6)
% An error occurred when concatenating the table variable 'Date' using VERTCAT.
%
% Caused by:
% Error using datetime/vertcat (line 1348)
% All inputs must be datetimes or date/time character vectors or date/time strings.
By the way, I don't mind removing the whole date column… I tried that, it might be why I'm getting this error message…
I want to go from state 1 here to state 2:
THANKS TO ANYBODY WHO HELPS!

Best Answer

Summary of comments under the question:
1) Remove the datetime column from each table.
T_noDT = cellfun(@(T){T(:,2:end)}, c)
2) To maintain the index number of each table after concatenating, fill empty cells with tables of missing data.
% C is your cell array
% If this is done before you remove the datetime column,
C(cellfun(@isempty, C)) = {table(NaT, nan, nan, nan, nan, nan)};
% If this is done after you remove the datetime column,
C(cellfun(@isempty, C)) = {table(nan, nan, nan, nan, nan)};
Updated to show that this works with OP's data
% Clear out the workspace and load the data
clear
load('historyfile.mat', 'history3')
% remove 1st col
C = cellfun(@(T){T(:,2:end)}, history3);
% Replace empties with nan tables; use headers from 1st table
% This assumes the first element of history3 is not empty.
C(cellfun(@isempty, C)) = {table(nan, nan, nan, nan, nan, ...
'VariableNames', C{1}.Properties.VariableNames)};
% Vertically concatenate
T = vertcat(C{:});
% Show the first few rows
T(1:10, :)
% ans =
% 10×5 table
% High Low Open Close Volume
% ______ ______ ______ ______ __________
% 159.7 124.5 131.79 157.99 7.0769e+06

% 159.7 124.5 131.79 157.99 7.0769e+06
% 416 389.01 404.3 396.29 6.023e+05

% 416 389.01 404.3 396.29 6.023e+05
% 25.93 25.29 25.44 25.67 5.3935e+06
% 170.2 167.08 168.87 169.39 7.612e+05
% 102.13 98.028 99.55 101.17 5.573e+05
% 125.57 122.37 124.4 124.55 3.0624e+06
% 81.61 80.52 80.72 80.84 2.8356e+06
% 103.95 98.41 103.5 99.81 1.3078e+06