clear; clc;

file_list = dir;
filenames = {file_list(:).name};
A = regexp(filenames, '.+\.m', 'match');
mask = cellfun(@(x) ~isempty(x), A);
cellfun(@(f) fprintf('%s\\%s\n', pwd, f{:}), A(mask))