필터 지우기
필터 지우기

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

조회 수: 9 (최근 30일)
SUSHMA MB
SUSHMA MB 2017년 2월 28일
댓글: Jan 2017년 2월 28일
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
Stephen23
Stephen23 2017년 2월 28일
편집: Stephen23 2017년 2월 28일
@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 2017년 2월 28일
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".

댓글을 달려면 로그인하십시오.

답변 (1개)

KSSV
KSSV 2017년 2월 28일
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
KSSV
KSSV 2017년 2월 28일
Have you tried the code which I have given? Are you sure that your 82794x1 cell array have all row vectors?
KSSV
KSSV 2017년 2월 28일
You can also use:
iwant = [A{:}] ;

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by