Undefined function 'regexp' for input arguments of type 'struct'
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
ai ping Ng
le 4 Mar 2017
Commenté : Walter Roberson
le 17 Mar 2017
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
1 commentaire
Walter Roberson
le 5 Mar 2017
Are those things stored inside the files or are they part of the file names?
Réponse acceptée
Walter Roberson
le 5 Mar 2017
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
7 commentaires
Walter Roberson
le 17 Mar 2017
https://www.mathworks.com/matlabcentral/answers/57446-faq-how-can-i-process-a-sequence-of-files
Plus de réponses (1)
Image Analyst
le 5 Mar 2017
You didn't show us how you got FileList. Evidently it thinks it's a structure.
0 commentaires
Voir également
Catégories
En savoir plus sur Multirate Signal Processing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!