How to convert a cell array to a double array

I have computed the data in the cell as [3x1 cell] but actually i do not want this type of data all i need is to get the data in the form of [3x1 double]....I need to know is there any way to convert from cell to double array.. Any help is appreciated

 채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2015년 6월 7일
편집: Azzi Abdelmalek 2015년 6월 7일

0 개 추천

v={1;2 ;3}
out=cell2mat(v)

댓글 수: 5

Hina Iqbal
Hina Iqbal 2015년 6월 7일
편집: Hina Iqbal 2015년 6월 7일
b={{{3 ;4}; {1}; {5}; {2}};{{1;2}; {2}; {2}; {4}}}
b =
{4x1 cell}
{4x1 cell}
and the output i required is
b =
{4x1 double}
{4x1 double}
i have used this but it gives me error
bb=cell2mat(b)
Azzi Abdelmalek
Azzi Abdelmalek 2015년 6월 7일
편집: Azzi Abdelmalek 2015년 6월 7일
This is not what you asked for.. You said you have a 1x3 cell array, and you didn't mention that your cell are cells of cells with different sizes
Hina Iqbal
Hina Iqbal 2015년 6월 7일
편집: Hina Iqbal 2015년 6월 7일
Sorry i forgot to mention that... Anyways Thanks for the help i solved it myself
Also, you can't get
{4x1 double}
For your case it's
{5x1 double}
b={{{3 ;4}; {1}; {5}; {2}};{{1;2}; {2}; {2}; {4}}}
d= cellfun(@(y) cell2mat(cat(1,y{:})),b,'un',0)

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

태그

질문:

2015년 6월 7일

댓글:

2015년 6월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by