フィルターのクリア

How do you convert the cell within a cell to a vector?

2 ビュー (過去 30 日間)
L'O.G.
L'O.G. 2023 年 5 月 7 日
回答済み: Walter Roberson 2023 年 5 月 7 日
I have a cell of cells. The inner cell is a 1 x 1 and contains a vector. The vector in each inner cell might be of different length. How do I convert this inner cell into an ordinary vector?

採用された回答

Walter Roberson
Walter Roberson 2023 年 5 月 7 日
testcell = {{[1]} {[2 3]} {[4 5 6]}}
testcell = 1×3 cell array
{1×1 cell} {1×1 cell} {1×1 cell}
output = cellfun(@(C) C{1}, testcell, 'uniform', 0)
output = 1×3 cell array
{[1]} {[2 3]} {[4 5 6]}
testcell{2}
ans = 1×1 cell array
{[2 3]}
output{2}
ans = 1×2
2 3

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by