MATLAB: How can i create a table of 4 columns from a cell array of 19 columns and name those 4 columns

create table from subset of cell array

how can i create a table of 4 columns from a cell array of 19 columns and name those 4 columns

Best Answer

ic=[ ...]; % four vector of columns wanted
nam={'One', ...}; % cellstr array of names
t=cell2table(C(:,ic),'VariableNames',nam); % done
doc table
doc cell2table % for details, other options
With caveats cell content are conformant, etc., etc., etc., ...