cell array to 2d array

5 ビュー (過去 30 日間)
Moses
Moses 2022 年 9 月 7 日
編集済み: Walter Roberson 2022 年 9 月 7 日
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 日
cell2mat(YourCell(:))
Or in this case
vertcat(YourCell{:})

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by