Variable Depth Cell Array UnNesting Recursively

If I have a cell array with various types of data nested at different levels, how could I unpack the contents and place it into a normal array recursively?
Ex: cellArray = {{'hello}, {{'world'}{42}}, 'example'};
result = [ 'hello' 'world' 42 'example'];

1 件のコメント

Stephen23
Stephen23 2017 年 4 月 30 日
編集済み: Stephen23 2017 年 4 月 30 日
What exactly is a "a normal array"? I cannot find any reference to "normal array" in the list of MATLAB data types:
Is this the intended output?:
>> result = [ 'hello' 'world' 42 'example']
result = helloworld*example
Note that by concatenating the individual character arrays and a numeric value you will get one single string (1xN char) as an output, and convert the numeric value to the character with that encoding number.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File Exchange で Operators and Elementary Operations についてさらに検索

タグ

質問済み:

2017 年 4 月 30 日

回答済み:

2017 年 4 月 30 日

Community Treasure Hunt

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

Start Hunting!

Translated by