MATLAB: Could anyone help me how to split the {1×3 cell}

split

I want to split {1×3 cell} into three groups. Could anyone please help me on this.

Best Answer

function [] = partdisp(A,K)
if nargin>2
error('A maximum of two input argument is allowed.')
end
if ~iscell(A)
error('This function is only useful on the output from PARTITIONS.')
end
L = length(A);
fprintf('\n')
if iscell(A{1}{1})
if ischar(A{1}{1}{1})
f = '%s ';
else
f = '%g ';
end
for ii = 1:length(A)
for jj = 1:length(A{ii})
for kk = 1:length(A{ii}{jj})
fprintf(f,A{ii}{jj}{kk})
end
fprintf('\b ')
end
fprintf('\n')
end
else
if ischar(A{1}{1})
f = '%s ';
else
f = '%g ';
end
for ii = 1:length(A)
for jj = 1:length(A{ii})
fprintf(f,A{ii}{jj})
fprintf('\b ')
end
fprintf('\n')
end
end
fprintf('\n')