cell array to 2d array
조회 수: 19 (최근 30일)
이전 댓글 표시
Hi just wondering if theres a way to pull out elements of a cell array and putting the elements into rows of a 2D array.
These are the elements:
{[3 1 4 1 5]} {[1 4 1 5 9]} {[4 1 5 9 2]} {[1 5 9 2 6]} {[5 9 2 6 5]}
This is what I want
[3,1,4,1,5;1,4,1,5,9;4,1,5,9,2;1,5,9,2,6;5,9,2,6,5]
댓글 수: 0
답변 (1개)
Walter Roberson
2022년 9월 7일
편집: Walter Roberson
2022년 9월 7일
cell2mat(YourCell(:))
Or in this case
vertcat(YourCell{:})
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!