The behavior has changed since R2013a if you need to use the old behavior:
size(unique([],'legacy'))
If you need code for both versions, I would recommend writing some function that calls unique(x,'legacy') for new versions and unique(x) for old versions.
btw: same issue with union , intersect , setdiff , setxor and ismember
source share