Artifact 8cd049d628644021639b67f764e49b447072cc02d23e12b3b00c7de029983b44:
- File
mttroot/ntt/bin/trans/mttIsNumericText.m
— part of check-in
[745f0b3e31]
at
2003-10-20 17:10:30
on branch origin/master
— Added initial revision of ntt:
new transformation tools for using bond graphs with Matlab.
Copyright 2003 Dr. Dominic J. Diston. (user: geraint@users.sourceforge.net, size: 748) [annotate] [blame] [check-ins using] [more...] - File ntt/bin/trans/mttIsNumericText.m — part of check-in [af3953deae] at 2021-03-01 11:39:42 on branch master — Cleanup repository after cvs2git conversion. (user: jeff@gridfinity.com, size: 748) [annotate] [blame] [check-ins using]
function boolean = mttIsNumericText(text) if any(abs(text)==39) % MATLAB doesn't like apostrophes in text boolean = 0 ; elseif strcmp(text,'flow') % MATLAB invokes built-in function "flow" rather than treating it as text in str2num(text) !!! boolean = 0 ; elseif strcmp(text,'error') % MATLAB invokes built-in function "error" rather than treating it as text in str2num(text) !!! boolean = 0 ; else num = str2num(text) ; if isempty(num) boolean = 0 ; % ... contains non-numeric characters other than stand-alone "i" or "j" else boolean = isreal(num) ; % ... doesn't contain stand-alone "i" or "j" end end