collapse.m

バージョン 1.0.0.0 (526 Bytes) 作成者: Gerald Dalley
Removes degenerate portions of a cell array tree.
ダウンロード: 1.7K
更新 2006/2/21

ライセンスがありません

%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'}
%

引用

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

MATLAB リリースの互換性
作成: R14SP2
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersStructures についてさらに検索

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.0.0.0

Removed boilerplate copyright.