MATLAB: Undefined function ‘regexp’ for input arguments of type ‘struct’

extract

I want to extract keywords(which the word start with import.XXXX) from multiple files under annotation folder. I run my code like this, Y I get the error? Anybody can help?
r = dir(fullfile('C:\Users\ASUS\Desktop\AngryBirdTest\android\support\annotation', '*.java'));
for i=1:length(r)
p = regexpi(FileList,'import.\w*.\w*.\w*','match');
disp(p(i));
end

Best Answer

My guess:
projectdir = 'C:\Users\ASUS\Desktop\AngryBirdTest\android\support\annotation';
r = dir(fullfile(projectdir, '*.java'));
filenames = {r.name};
FileList = fullfile(projectdir, filenames);
for K = 1:length(FileList)
thisfile = FileList{K};
fprintf('\nExamining file "%s"\n', thisfile); %if desired
filecontent = fileread(thisfile);
p = regexpi(filecontent, 'import.\w*.\w*.\w*', 'match');
disp(p);
end