如何使"tHeader"成为表的Header?
tHeader = {'objectNum','File','Size'}
RowA = {1,2,3};
RowB = {4,5,6};
tReport = cell2table([tHeader; RowA; RowB])
调用函数时直接使用VariableNames
名称值对:
tReport = cell2table([RowA; RowB],'VariableNames',tHeader)
您可以按如下方式执行:
tReport.Properties.VariableNames = tHeader;