Make rows of square bracket data

1 回表示 (過去 30 日間)
Martin
Martin 2018 年 5 月 2 日
編集済み: jonas 2018 年 5 月 2 日
I have some data that looks like this string:
A='[[1,2,3,4,5,6],[6,5,4,3,2,1],[4,4,4,4,4,4],[9,9,9,9,9,9]]'
6 numbers in each square brackets. The data can be huge. I would like to achieve the following result:
1 2 3 4 5 6
6 5 4 3 2 1
4 4 4 4 4 4
9 9 9 9 9 9
So in this case I would prefer to receive a 4x6 double. I tried a couple of things with reshape(), but with no luck. Any ideas?
Thanks

採用された回答

jonas
jonas 2018 年 5 月 2 日
編集済み: jonas 2018 年 5 月 2 日
A=str2num(A)
reshape(A,[6 4])'

その他の回答 (0 件)

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by