MATLAB: Assign an empty table

table

Hi,
I am trying to assign an empty table (lets say "groupData" to be used later in the for loop. In the loop I use another table and fill the groupData. Later on I would like to empty the table (groupData) and refill again and so. I tried the following code , did not work.
I got the error o convert a table to numeric, use the TABLE2ARRAY function. Is there a way to assign an empty table without using table2array, because I use the groupData data after the for loop to get the data with their variable names. Like
if (groupData.Node(i)==4000)&& (groupData.Cell(i+1)==11)
Thank you
Birsen
Here is the code
==============
for h=1:3
k=newK;
m=1;
groupData(:,:)=0
while pData.Node(k)~=4000
groupData(m,:)=pData(k,:)
k=k+1;
m=m+1;
end
newK=k+1;
end

Best Answer

I think I resolved it as follows:
groupData = array2table(zeros(0,9));
groupData.Properties.VariableNames = {'Node','x2', ...
'x3','Cell', 'x5','x6','x7', 'x8', 'x9'}
Just defining groupData = array2table(zeros(0,9)) was not sufficient. I had to also use
groupData.Properties.VariableNames = {'Node','x2', ...
'x3','Cell', 'x5','x6','x7', 'x8', 'x9'}