Read numbers from a string.

버전 1.4.0.0 (2.84 KB) 작성자: DS
The function PARSE_NUMBERS applies SSCANF to read numbers from delimited string.
다운로드 수: 202
업데이트 날짜: 2012/3/28

라이선스 보기

A = PARSE_NUMBERS(S) separates the string, S, into a cell array of substrings which are individually scanned to determine numeric values; results are returned in matrix A.

The behavior of PARSE_NUMBERS can be modified by additional options which are specified as propertyName/propertyValue string pairs; lists of values can be specified as cell arrays of strings.

Options:
NAME / VALUE
-------------------
'del' --delimeter strings
'key' --identifier strings
'dec' --alternative decimal strings
'fmt' --format string passed to sscanf

-----
Please note: There are many ways to achieve similar results by applying one or more of the built-in Matlab string handling functions directly.

Good info here: http://blogs.mathworks.com/loren/2006/12/20/finding-strings/
and here: http://blogs.mathworks.com/loren/2006/04/05/regexp-how-tos/

Also of interest, see the function 'expandstr' in submission FEX 12180.

인용 양식

DS (2024). Read numbers from a string. (https://www.mathworks.com/matlabcentral/fileexchange/35802-read-numbers-from-a-string), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2007b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 String Parsing에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.4.0.0

Added checks for empty and non-string inputs.

1.1.0.0

Edited help and comments, no code changes.

1.0.0.0