Effacer les filtres
Effacer les filtres

Combine cell array inside a cell array.

1 vue (au cours des 30 derniers jours)
ANURAG DEEPAK
ANURAG DEEPAK le 14 Nov 2021
Commenté : ANURAG DEEPAK le 14 Nov 2021
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];

Réponse acceptée

Walter Roberson
Walter Roberson le 14 Nov 2021
Last2 = @(V) V(2:end);
B = [A{1,1}, cell2mat(cellfun(Last2, A(2:end), 'uniform', 0))]
  1 commentaire
ANURAG DEEPAK
ANURAG DEEPAK le 14 Nov 2021
Thank you very much Sir for quick response.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by