wolffd@0: function idx = findString(str, cellArray,ignoreCase) wolffd@0: % Returns a boolean matrix the same size as cellArray with true everywhere wolffd@0: % the corresponding cell holds the specified string, str. wolffd@0: wolffd@0: if nargin < 3, ignoreCase = false; end wolffd@0: if ignoreCase, fn = @(c)strcmpi(c,str); else fn = @(c)strcmp(c,str); end wolffd@0: idx = cellfun(fn,cellArray); wolffd@0: end