You can generate a discrete probability distribution for your integers using the hist function:
data = [1 2 3 3 4]; %
And here is the result:

UPDATE:
In newer versions of MATLAB, hist no longer recommended. Instead, you can use the histcounts function to create the same pattern as above:
data = [1 2 3 3 4]; N = histcounts(data, 'BinLimits', [0 10], 'BinMethod', 'integers', 'Normalization', 'pdf'); plot(N); xlabel('Integer value'); ylabel('Probability');
source share