It would be nice if this checked for floating point differences as well.
Ex:
a = [0 0.1 0.2 0.3 0.4];
b = [0:0.1:0.4];
>> [v n] =howmany([a b])
%%%%%%%%%%%%%
v =
0
0.1
0.2
0.3
0.3
0.4
n =
2
2
2
1
1
2
Because the arrays a and b are essentially equal (within eps):
%%%%%%%%%%
>> abs(a-b)<eps
ans =
1 1 1 1 1
>> isequal(a,b)
ans =
0
%%%%%%%%%%
you should at least give an option to count them as the same number.