FMdir is a struct array with fields such as name and folder . You would not want to dynamically construct references to the fields of that struct.
FMdir = dir('*FM*.ep'); %Get a list of all of the final measurement files in the directory
FMn = numel(FMdir);
for n = 1 : FMn
thisname = FMdir(n).name;
[~, basename, ext] = fileparts(thisname);
as_num = str2double(basename);
if ~isnan(as_num)
%filename was purely numeric
end
end
However... not even one of the filenames you post is purely numeric. Did you want to extract up to the first underscore and test that to see if it is numeric?
nameparts = regexp(basename, '_', 'split');
as_num = str2double(nameparts{1});