I came up with a different solution. I am attaching it here if it helps anyone.
I basically created an index for eax individual array i was trying to create. I scanned over the whole table and then assigned the values to different arrays to work with the values
IndxFeb=1;
IndxMar=1;
LenghtDataset = height(Dataset_Table); %Get the number of rows in the Dataset_Table
%Checks the Timestap to assign values to the correct arrays
for i=1:size(Dataset_Table)
%----------------------------------------------------------------------
%Check if it's January
if (Dataset_Table{i,1} <= datetime(2019,01,31))
JanuaryTime(i)= Dataset_Table{i,1};
JanuaryGHI(i)= Dataset_Table{i,4};
JanuaryTamp(i)= Dataset_Table {i,6};
end
%----------------------------------------------------------------------
%End of January Test
%----------------------------------------------------------------------
%----------------------------------------------------------------------
%Check if it's February
if (Dataset_Table{i,1} >= datetime(2019,02,01) && Dataset_Table{i,1} <= datetime(2019,02,29))
FebruaryTime(IndxFeb)= Dataset_Table{i,1};
FebruaryGHI(IndxFeb)= Dataset_Table{i,4};
FebruaryTamp(IndxFeb)= Dataset_Table {i,6};
IndxFeb = IndxFeb + 1;
end
%----------------------------------------------------------------------
%End of February Test
%----------------------------------------------------------------------
%----------------------------------------------------------------------
%Check if it's March
if (Dataset_Table{i,1} >= datetime(2019,03,01) && Dataset_Table{i,1} <= datetime(2019,03,31))
MarchTime(IndxMar)= Dataset_Table{i,1};
MarchGHI(IndxMar)= Dataset_Table{i,4};
MarchTamp(IndxMar)= Dataset_Table {i,6};
IndxMar = IndxMar + 1;
end
%----------------------------------------------------------------------
%End of March Test
%----------------------------------------------------------------------
.......