如何将单元格的第一行作为表头?
代码:
clc;
clear;
close all;
myCell = {'RowA', 'RowB', 'RowC'; 11, 22, 33;11, 22, 33}
myTable = cell2table(myCell);
>> myTable = cell2table(myCell(2:end,:),'VariableNames',myCell(1,:))
myTable =
2×3 table
RowA RowB RowC
____ ____ ____
11 22 33
11 22 33