How to access induvidual elements in a string
信息
此问题已关闭。 请重新打开它进行编辑或回答。
显示 更早的评论
I have a many strings of format "xhrs ymin".
where x and y are numbers
i want to store x and y in separate integers.
how do i do it?
1 个评论
madhan ravi
2019-6-15
回答(1 个)
Stephen23
2019-6-15
The simplest and most efficient solution is to use sscanf:
>> S = '23hrs 45min';
>> V = sscanf(S,'%fhrs%fmin')
V =
23
45
0 个评论
此问题已关闭。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!