Combine cell array inside a cell array.

2 ビュー (過去 30 日間)
ANURAG DEEPAK
ANURAG DEEPAK 2021 年 11 月 14 日
コメント済み: ANURAG DEEPAK 2021 年 11 月 14 日
I want to combine the cell arrays inside a cell array. The only condition to combine is to select the cell array elements from second index starting from second cell array. For example:
A = cell(1, 3);
A(:) = {rand(1,3)};
The output variable B should be:
B = [0.7943 0.3112 0.5285 0.3112 0.5285 0.3112 0.5285];

採用された回答

Walter Roberson
Walter Roberson 2021 年 11 月 14 日
Last2 = @(V) V(2:end);
B = [A{1,1}, cell2mat(cellfun(Last2, A(2:end), 'uniform', 0))]
  1 件のコメント
ANURAG DEEPAK
ANURAG DEEPAK 2021 年 11 月 14 日
Thank you very much Sir for quick response.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by