|
"Pr B" <pb2297@columbia.edu> wrote in message <j1u48e$jhh$1@newscl01ah.mathworks.com>...
> i have an issue with strtok. I am trying to parse a string of the following form:
>
> a = '10_ash_ajs_74_29_ah_23_ah_59'
>
> i am only interested in the number right after the last underscore in the string, reading left to right. this would be the number 59. i am trying to use [tok,remain] = strtok(a,'_') but remain always gives me '_ash_ajs_74_29_ah_23_ah_59'. i need to use successive calls to strtok to get to the part of the string i'm interested in by [tok,remain] = strtok(remain,'_'), but is there a better way to do this?
tok = fliplr(strtok(fliplr(a),'_'))
|