I have:
filename = Synch_ab001.mat;underscore_indices = strfind(filename, '-');period_indices = strfind(filename, '.');SubjectName = strtok(filename(underscore_indices(end)+1:period_indices(end)-1));
I wrote this to extract just the ab001 as SubjectName, but I keep getting a "subscript indices must either be real positive integers or logicals."
Best Answer