mergecell
% OUT = MERGECELL(IN1,IN2,...INx,DIM)
%
% MERGECELL simply merges cell arrays (IN1,IN2,...,INx) together by
% appending them along the DIM dimension. There is no requirement that the
% input cell arrays have similar dimensions. The result is a cell array
% large enough to accomodate the sizes of each input array with blanks
% filling the empty spots.
%
% Example:
%
% a{1} = {'a','b','c','d','e'};
% a{2} = {'f';'g';'h'}; %-- Notice these are different orientations
%
% out = mergecell(a{:},1)
%
% returns: 'a' 'b' 'c' 'd' 'e' 'f'
% [] [] [] [] [] 'g'
% [] [] [] [] [] 'h'
%
%
% out = mergecell(a{:},2)
%
% returns: 'a' 'b' 'c' 'd' 'e'
% 'f' [] [] [] []
% 'g' [] [] [] []
% 'h' [] [] [] []
%
%
% out = mergecell(a{1},a{2}',1)
%
% returns: 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h'
%
%
% Copyright (C) 2011 Jeremy Brower.
% jeremy.brower@gmail.com
Cite As
Jeremy (2024). mergecell (https://www.mathworks.com/matlabcentral/fileexchange/30780-mergecell), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 |