How to delete an element k in a cell array in a for loop? l have a set called neighbour_n{i} where i varies from 1 to n But it returns me this error :
??? Cell contents reference from a non-cell array object.
Error in ==> @(d)setxor([d{:}],[k])
Error in ==> broadcastelimination at 118 cellfun(fun, neighbour_n, 'UniformOutput', false)
neighbour_n=cell(N,1);N = numel(neighbour_n);for i=1:N if (ismember(k, neighbour_n{i})); idx = find(cell2mat(neighbour_n{i}) == k); neighbour_n{i}(idx) = []; endend
Best Answer