i asked a question here and sir andrei bobrov came out with a good solution here http://www.mathworks.in/matlabcentral/answers/34805-sorting-and-counting
a = [ 1 2 5 7] ; b = [ 9 9 3 4] ;[aa bb] = ndgrid(a,b);k = [aa(:) bb(:)];[n1, n2, n2] = unique(k,'rows');n3 = histc(n2,1:max(n2));out = [n1, n3]
but what i ask is if i have to input a cell with values as
['172.20.1.1' '172.20.0.31' '172.20.114.29']
and perform the same program i am getting error as
??? Undefined function or method 'full' for input arguments of type 'cell'.Error in ==> ndgrid at 38 varargin{i} = full(varargin{i}); % Make sure everything is full
Error in ==> bob at 3[aa bb] = ndgrid(a,b);
any solutions please ??
Best Answer