Extracting numbers from a filename
조회 수: 33 (최근 30일)
이전 댓글 표시
I have a filename (data_23.175_75.125) . I want to extract the numbers from this file name and store them in different variable matrices. How can I do it?
댓글 수: 0
답변 (1개)
Akira Agata
2019년 1월 11일
편집: Akira Agata
2019년 1월 11일
How about using regular expression?
The following is a simple example.
fileName = 'data_23.175_75.125';
num = regexp(fileName,'[\d\.]+','match');
num = str2double(num);
The result is:
>> num
num =
23.1750 75.1250
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!