Effacer les filtres
Effacer les filtres

How to Unnest cell array with nested cells to a cell array?

9 vues (au cours des 30 derniers jours)
SUSHMA MB
SUSHMA MB le 28 Fév 2017
Commenté : Jan le 28 Fév 2017
How do I expand out an array with dimension '<82794x1 cell>' in which each cell has different dimension like;
[1x12] double
[1x18] double
[1x6] double
[1x14] double
[1x6] double
[1x10] double
[1x6] double
[1x8] double.....and so
  2 commentaires
Stephen23
Stephen23 le 28 Fév 2017
Modifié(e) : Stephen23 le 28 Fév 2017
@SUSHMA MB: please run this command and tell us exactly what it displays (C is the name of your cell array):
find(cellfun('size',C,1)>1)
Jan
Jan le 28 Fév 2017
The shown data looks like they are a cell already and not a "nested cells". Please post the type and the dimensions of the wanted output. e.g. "{1 x N} cell containing [1 x M] vectors".

Connectez-vous pour commenter.

Réponses (1)

KSSV
KSSV le 28 Fév 2017
Let A be your cell array. Try cell2mat(A)
Eg:
A{1} = rand(1,10) ;
A{2} = rand(1,11) ;
A{3} = rand(1,7) ;
iwant = cell2mat(A)'
  3 commentaires
KSSV
KSSV le 28 Fév 2017
Have you tried the code which I have given? Are you sure that your 82794x1 cell array have all row vectors?
KSSV
KSSV le 28 Fév 2017
You can also use:
iwant = [A{:}] ;

Connectez-vous pour commenter.

Catégories

En savoir plus sur Data Type Conversion 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