strfind
is only available from R2013a and onwards. You can certainly use regexp
like you have done before, but look for the /
symbol instead. Look for the last occurrence of the /
symbol, then use that and subset the rest of your string just like what Highman is doing. In other words:
aa = 'SAN/MOST/MOD10A1.005/2000.02.26/MOD10A1.A2000057.h01v10.005.2007163034521.hdf.xml';
idx = regexp(aa, '\/');
aaSubset = aa(idx(end)+1 : end);
Take note that I had to use the \
character and place it before the /
character as /
is a reserved symbol when looking at regular expressions. aaSubset
contains the string that you're looking for. I get:
aaSubset =
MOD10A1.A2000057.h01v10.005.2007163034521.hdf.xml