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]

답변 (1개)

Walter Roberson
Walter Roberson 2022년 9월 7일
편집: Walter Roberson 2022년 9월 7일

0 개 추천

cell2mat(YourCell(:))
Or in this case
vertcat(YourCell{:})

카테고리

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

질문:

2022년 9월 7일

편집:

2022년 9월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by