Flatten nested cell arrays

Version 1.0.0.1 (1.29 KB) by Manu R
Linearize a cell array tree structure
1.4K Downloads
Updated 1 Sep 2016

View License

C1 = flatten({{1 {2 3}} {4 5} 6})
C2 = flatten({{'a' {'b','c'}} {'d' 'e'} 'f'})

% Outputs:
C1 =
[1] [2] [3] [4] [5] [6]
C2 =
'a' 'b' 'c' 'd' 'e' 'f'

Cite As

Manu R (2024). Flatten nested cell arrays (https://www.mathworks.com/matlabcentral/fileexchange/27009-flatten-nested-cell-arrays), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Matrices and Arrays in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.1

Updated license

1.0.0.0