Let's say I have a string as follows:
string = '2.3A 4B C'
I want to apply a function that will output the following:
[2.3 4 1]
where these values are simply the "prefixes" (converted to doubles) of the letters specified within the string. One important note is that any letter lacking a prefix should output a 1.
My first thought was to use sscanf and include some condition for letters lacking prefixes, but it hasn't quite worked the way I'd like.
Any suggestions from the Matlab world?
Thanks!
Best Answer