Determining the value of ECDF at a point using Matlab I have a data $X=[x_1,\dots,x_n].$
In Matlab, I know by using
[f,x]=ecdf(X)
plot(x,f)

we will have the empirical distribution function based on $X$.
Now, if $x$ is given, how will I know the value of my ECDF at this point?

Using interp1 is a nice idea. But we should not use 'nearest' option. Instead, to get the right result we must use 'previous' option because ecdf functions are flat except their jumping points. Also don't forget dealing with. I recommend, if [f, x] is given from ecdf command, to use
y = interp1(x, f, vec_eval, 'previous');
y(vec_eval < min(original data)) = 0;
y(vec_eval >= max(original data)) = 1;
where vec_eval is the vector of points you want to evaluate
