# MATLAB: How to get upper and lower bounds values from an empirical cumulative distribution

cdfconfidence intervalsecdfempirical confidenceerror analysisMATLAB

Hi, thanks for looking at my question. I've been googling, looking on here, and reading the Matlab documentation all afternoon and I can't work this out. I'm sure it's very simple, but I'm new to Matlab syntax so I need some help please!
I have a vector, which is a list of parameters from some data fitting. Specifically it's 250 values.
I want to find the 95% confidence bounds for the numbers in this vector. I can plot an ecdf: I can also get the [x,y] values for this ECDF using:
``[cdf_x,cdf_y] = ecdf(data_vector)cdf = [cdf_x,cdf_y]``
Where I am struggling is I cannot work out how to get the 95% upper and lower values from the array "cdf" (or any of the previous variables I've generated along the way). It's all empirical, so I just want to know the two values of cdf_y where cdf_x equals 0.025 and 0.975.
How can I do this?
NB. cdf_x doesn't have values specifically at 0.025 or 0.975 so it needs to either interpolate or give the closest result if possible.

``prctv = prctile(cdf_y, [2.5 97.5]);xval = interp1(cdf_y, cdf_x, prctv);``