1
MyCell是一个5x10字符串单元格(文件名)。我想根据字符串匹配删除每个5个单元格中的一个元素。与cellfun一起使用setdiff给出错误
如果键入:
setdiff(MyCell{1,1}, {'Dontwant.mat'})
它的作品,我与其余元素的9元细胞。
现在我想为每个5元做到这一点,但如果我的剧本包括:
MyCell=cellfun(@(x) setdiff({x},{'Dontwant.mat'}), MyCell , 'uniformoutput', 0);
我得到以下错误:
Error using cell/setdiff>cellsetdiffR2012a (line 292) Input A of class cell and input B of class cell must be cell arrays of strings, unless one is a string.
Error in cell/setdiff (line 84) [varargout{1:nlhs}] = cellsetdiffR2012a(varargin{:});
任何帮助将非常感激。
删除'{}'在'setdiff'内? –