Convert cells from cell array to matrices

조회 수: 1 (최근 30일)
Dimitris Pasias
Dimitris Pasias 2016년 12월 13일
편집: Stephen23 2019년 6월 19일
Hi! I have a cell array A{ 80 x 1 } cells of different dimensions i.e cell1=18x2 , cell2=20x2, cell3=34x2 etc.I want to extract each cell from the cell array A and convert each of them to a matrix. i.e Answer shpold be :A1=the 18 X2 matrix of cell1 A2= the 20x2 matrix of cell 2 etc or A(:,:1)=18x2 A(:,:2)=2-x2 etc. I would prefer if possible to have 80 matrices A1,A2,A3......A80. Thank you.
  댓글 수: 3
Dimitris Pasias
Dimitris Pasias 2016년 12월 13일
편집: Dimitris Pasias 2016년 12월 13일
i tried using the code
for e=1:80
cell2mat(A(e,1))
end
but i dont know how to save the ansewrs to the worspace
Stephen23
Stephen23 2016년 12월 13일
편집: Stephen23 2016년 12월 13일
@Dimitris Pasias: read and understand this:
Then learn to use indexing, and/or cell arrays.

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

답변 (2개)

the cyclist
the cyclist 2016년 12월 13일
Here is one of many answers on this forum that discusses the reason why this is a bad idea.

Stephen23
Stephen23 2016년 12월 13일
편집: Stephen23 2019년 6월 19일

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by