i have a array that contains all the files in a particular directory. I want to remove all the file entries that end with the .txt extension. This is what i have written
function fileList = removeElements(fileArray)
for idx = 1:numel(fileArray)
if (strfind(fileArray(idx),'.txt') > 0 )
display('XX');
fileArray(idx) =[];
end
end
end
but i get a error
??? Undefined function or method 'gt' for input arguments of type 'cell'.
Error in ==> removeElements at 6
if( strfind(fileArray(idx),'.bmp') > 0 )
can someone please help me
>0is wrong in this case. Use~isempty(strfind(....))instead.