Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Re: oneliner to parse an alphanumeric string
Posted:
Nov 22, 2005 12:41 PM


Jos wrote: > ... > Using regular expressions and <strread> might do: > > s = 'P245/45ZR18' ; > [SW,AR,RD] = strread(regexprep(s,'\D',' '),'%f %f %f') ; > > should work for any string with three (positive) numbers with any > number (>0) of nondigits in between ...
Nice...I don't have a new enough version of Matlab to have either function so had use a more traditional approach.



