%% Split Variables
% Create a table from workspace variables. Some of the variables are matrices with multiple columns.

A = (1:3)';
B = [5 11 12; 20 30 50; 0.1 3.4 5.9]';
C = {'a','XX';'b','YY';'c','ZZ'};
D = [128 256 512]';
T1 = table(A,B,C,D)

%
% Split the variables B and C. All variables in the output table have one column.

T2 = splitvars(T1)

% Copyright 2012 The MathWorks, Inc.