If we have a discrete random variable x and the data pertaining to it in X(n), how in matlab can we determine the probability mass function pmf(X)?
How about this function?
function Y = pmf(X) A=tabulate(X) A(:,3)=A(:,3)/100 Y=A(:,3)'
Is this correct in your opinion?