How to get histogram data object from matlab
%Let's say:
X = [1 2 3 4 4 4 3 2 1 5 10];
Num = input("Please enter the number");
temp = X == Num;

%let's assume Num in this case is 4
%temp = [0 0 0 1 1 1 0 0 0 0 0]

ans = sum(temp);


ans = 3

This is a quick and an effective way to find the number of occurrences of a particular value.