collapse.m

Removes degenerate portions of a cell array tree.
1,7K descargas
Actualizado 21 feb 2006

Sin licencia

%c = collapse(c)
% Takes a recursive cell array as a tree and collapses any branches
% having a fanout of 1. Any elements with fanout of 0 are removed.
%
%Examples:
% collapse({1 2 3}) --> {1 2 3}
% collapse({{1} {2} {{3}}}) --> {1 2 3}
% collapse({1 {2 3}}) --> {1 {2 3}}
% collapse({1 {{} 2 {{}} 3}}) --> {1 {2 3}}
% collapse({{{}}}) --> {}
%
% [matches] = regexp({'abc', 'def', 'fghi'}, '[^f]*f+[^f]*', 'match');
% collapse(matches) --> {'def' 'fghi'}
%

Citar como

Gerald Dalley (2024). collapse.m (https://www.mathworks.com/matlabcentral/fileexchange/10005-collapse-m), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R14SP2
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Categorías
Más información sobre Structures en Help Center y MATLAB Answers.

Community Treasure Hunt

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

Start Hunting!
Versión Publicado Notas de la versión
1.0.0.0

Removed boilerplate copyright.