Combine cell array inside a cell array.

1 次查看(过去 30 天)
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))]

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by