StringIsNumber

버전 1.0.0.0 (597 Bytes) 작성자: Michael Robbins
STRINGISNUMBER returns 1 if the input string contains only a number and otherwise a zero.
다운로드 수: 2.1K
업데이트 날짜: 2004/11/22

라이선스 없음

STRINGISNUMBER returns 1 if the input string contains only a number and otherwise a zero

Created as an example for the thread "How to determine if an inputfield contains chars or numbers ?"

USAGE:
>> StringIsNumber('aseea')
ans = 0
>> StringIsNumber('333')
ans = 1
>> StringIsNumber('333.123')
ans = 1
>> StringIsNumber('.123')
ans = 1
>> StringIsNumber('0.123')
ans = 1
>> StringIsNumber('0.123a')
ans = 0

IT'S NOT FANCY BUT IT WORKS

인용 양식

Michael Robbins (2024). StringIsNumber (https://www.mathworks.com/matlabcentral/fileexchange/6283-stringisnumber), MATLAB Central File Exchange. 검색됨 .

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

Community Treasure Hunt

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

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

Digits followed by a period but no more digits is now considered a number.

A single period is no longer considered a number.

Vector inputs and outputs are supported.