Put a number from a header into a variable?
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a text file containing the value of a time step (in the header), which I want to assign to a variable. How can I extract this number (just the time step), since the header also contains words? I have provided the header below:
Lead Number 1 Time Step .001 Data Points 6001
댓글 수: 0
답변 (1개)
Azzi Abdelmalek
2016년 7월 13일
편집: Azzi Abdelmalek
2016년 7월 13일
s='Lead Number 1 Time Step .001 Data Points 6001 '
ts=str2double(regexpi(s,'Step\s*(\d?\.?\d+)','tokens','once'))
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 String Parsing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!