How to make a matrix from the cells inside the cell?

조회 수: 1 (최근 30일)
Daria Ivanchenko
Daria Ivanchenko 2020년 6월 22일
댓글: Daria Ivanchenko 2020년 6월 22일
Hi! I have a cell variable, the size is 4 by 3. The third column of the variable contains cells again. I want to extract the numbers that I have inside every cell of the third column and make a usual double variable. How can I do this?
Example: A = 4x3 cell.
1 1 1x1 cell
1 2 2x1 cell
1 3 5x1 cell
1 4 3x1 cell.
Every cell of the third column has cells with only one number inside. I want to get these numbers out. So in the end I want to have a matrix of 1+2+5+3 rows from the A cell. Is it possible to do it?
Thanks you!

채택된 답변

madhan ravi
madhan ravi 2020년 6월 22일
편집: madhan ravi 2020년 6월 22일
Z = A(:,3);
Wanted = cell2mat(cat(1, Z{:}))

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by