I have an array containing all the files in a specific directory. I want to delete all file entries that end with the .txt extension. This is what I wrote
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 an 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
source
share