Assuming you have the file name as a variable, I'll use myName:
myName = lower(myName);
idx = strfind(str,'composite');
if ~isempty(idx)
else
end
You need to find if 'Composite' is in the file name. strfind() returns the indices where it finds the match as a vector, if it doesn't find anything, it returns the empty vector. If you check whether or not the vector is empty, you can check whether or not 'Composite' is in the file name. I used lower() because strfind() is case sensitive. If case matters, you can just ignore the line
1 Comment
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/252891-excluding-files-with-a-certain-keyword-in-them#comment_1228227
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/252891-excluding-files-with-a-certain-keyword-in-them#comment_1228227
Sign in to comment.