Loading data from document and isolating numbers.
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi, I have to add to creating program a complicated database from other file with united numbers sometimes with no space between them. Which formula should I use to load from random line in data document, and isolate them to other calculations.
Example 1.543 345.1200 1.32399.0099.00 1.3399.00
Thank you.
댓글 수: 4
Thorsten
2013년 1월 9일
Unless you have some further information about the values of the numbers (e.g., always > 10) or the format (e.g., number of significant digits) you cannot retrieve the original numbers, because you can cut a chunk of digits at any positions other than those just before and after a . that would leave you with this single '.', which is not a number.
채택된 답변
Walter Roberson
2013년 1월 9일
NumericLine = str2double( regexp( regexprep(TheLine, '99\.0', ' &'), '\s+', 'split') );
댓글 수: 2
Walter Roberson
2013년 1월 10일
You would need to have scanned the line as a string, so you might as well fgetl() instead of fscanf()
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Database Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!