我有一个包含特定目录中所有文件的数组.我想删除所有以.txt扩展名结尾的文件条目.这就是我写的
function fileList = removeElements(fileArray)
for idx = 1:numel(fileArray)
if (strfind(fileArray(idx),'.txt') > 0 )
display('XX');
fileArray(idx) =[];
end
end
end
Run Code Online (Sandbox Code Playgroud)
但我得到一个错误
??? Undefined function or method 'gt' for input arguments of type 'cell'.
Error in ==> removeElements at 6
if( strfind(fileArray(idx),'.bmp') > 0 )
Run Code Online (Sandbox Code Playgroud)
有人可以帮帮我吗