StringIsNumber
by Michael Robbins
15 Nov 2004
(Updated 22 Nov 2004)
STRINGISNUMBER returns 1 if the input string contains only a number and otherwise a zero.
|
Watch this File
|
| File Information |
| Description |
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 |
| MATLAB release |
MATLAB 7.0.1 (R14SP1)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (2) |
| 07 Jul 2006 |
Jaroslaw Tuszynski
|
|
|
| 08 Jul 2010 |
Jan Simon
|
|
|
| Updates |
| 18 Nov 2004 |
A single period is no longer considered a number. It must be succeeded by a digit.
Vector inputs and outputs are supported. |
| 22 Nov 2004 |
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. |
|
Contact us at files@mathworks.com