I am getting the error:
Error using contains First argument must be a string array, character vector, or cell array of character vectors.
Error in xlsxdatatostructurearray/getgastablelisting (line 17) TF1 = contains(Directory{d},FilePrefix,'IgnoreCase',true);
Error in xlsxdatatostructurearray (line 25) for l = 1:length(getgastablelisting(FilePrefix, DirectoryName, filetype))
please help.
This is the code that is giving the error.
function [LookupTableFiles] = getgastablelisting(FilePrefix, DirectoryName, filetype) LookupTableFiles = {}; Directory = dir(DirectoryName); Directory = struct2cell(Directory); for d = 1:length(Directory) TF1 = contains(Directory{d},FilePrefix,'IgnoreCase',true); TF = contains(Directory{d},filetype,'IgnoreCase',true); if (TF1 == 1) && (TF == 1) LookupTableFiles = {LookupTableFiles Directory{d}}; end end end
Best Answer