Split multiple cells into columns.
3 次查看(过去 30 天)
显示 更早的评论
Hello,
I currently have a variable that has 46000 rows and 1 column.
Each cell looks something like this:
'0 0 0 0 0 821 69 34 15 0000'
I would like to have each of these numbers (as separated by either 1 or 2 spaces) to be in different columns.
The output would therefore be 46000 rows and 10 columns.
I am not sure how to do this and any help would be appreciated!
0 个评论
采纳的回答
Walter Roberson
2016-2-22
temp = regexp(YourCell(:), '\s+', 'split');
temp = horzcat(temp{:});
result = str2double(temp);
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Automated Driving Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!