How to make two column vectors from cell vector with space delimiter?
1 次查看(过去 30 天)
显示 更早的评论
I've one cell vector (3000by1) and I'm trying to make this into two column vectors.
C= '2020-06-29 11'
'2020-06-29 11'
'2020-06-29 11'
'2020-06-29 11'
'2020-06-29 11'
I want to seperated date and hour (11 is hour value here).
0 个评论
采纳的回答
madhan ravi
2020-6-30
S = regexp(C, '\s', 'split');
s = cat(1, S{:});
datE = s(:,1)
HouR = s(:,2)
3 个评论
madhan ravi
2020-6-30
C= {'2020-06-29 11'
'2020-06-29 11'
'2020-06-29 11'
'2020-06-29 11'
'2020-06-29 11'}
S = regexp(C, '\s', 'split');
s = cat(1, S{:});
datE = s(:,1)
HouR = s(:,2)
C =
5×1 cell array
{'2020-06-29 11'}
{'2020-06-29 11'}
{'2020-06-29 11'}
{'2020-06-29 11'}
{'2020-06-29 11'}
datE =
5×1 cell array
{'2020-06-29'}
{'2020-06-29'}
{'2020-06-29'}
{'2020-06-29'}
{'2020-06-29'}
HouR =
5×1 cell array
{'11'}
{'11'}
{'11'}
{'11'}
{'11'}
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dates and Time 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!