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!