For some reason Numpy's hist always returns one less bin than MATLAB's hist:
for example in MATLAB:
x = [1,2,2,2,1,4,4,2,3,3,3,3];
[Rep,Val] = hist(x,unique(x));
gives:
Rep = [2 4 4 2]
Val = [1 2 3 4]
but in Numpy:
import numpy as np
x = np.array([1,2,2,2,1,4,4,2,3,3,3,3])
Rep, Val = np.histogram(x,np.unique(x))
gives:
>>>Rep
array([2, 4, 6])
>>>Val
array([1, 2, 3, 4])
How can I get identical results ti MATLAB's?