Cumulative distribution function of vector -doesn't work correctly

Hi,
I need to use cdf function. It works on simple vector like x=[-3:0.1:3], but not for my vector and data.
oh2L1=[0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.017 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.017 0.009 0.009 0.009 0.017 0.017 0.009 0.017 0.009 0.017 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.017 0.017 0.017 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.017 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.017 0.009 0.009 0.009 0.017 0.017 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.017 0.017 0.017 0.017 0.009 0.009 0.017 0.017 0.017 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.017 0.009 0.009 0.009 0.017 0.017 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.026 0.017 0.017 0.017 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.017 0.009 0.017 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.017 0.017 0.017 0.017 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.017 0.017 0.009 0.009 0.017 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.017 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.017 0.017 0.017 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.017 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.017 0.140 0.331 0.227 0.183 0.244 0.323 0.305 0.201 0.253 0.201 0.227 0.262 0.201 0.201 0.166 0.174 0.201 0.209 0.140 0.227 0.244 0.227 0.192 0.105 0.096 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017];
oh2L2=[0.009 0.017 0.017 0.009 0.017 0.009 0.009 0.009 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.009 0.017 0.017 0.009 0.017 0.017 0.017 0.017 0.009 0.009 0.017 0.017 0.017 0.017 0.009 0.009 0.017 0.009 0.009 0.009 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.009 0.017 0.017 0.017 0.017 0.017 0.017 0.009 0.017 0.017 0.017 0.009 0.017 0.009 0.017 0.017 0.017 0.009 0.017 0.017 0.017 0.009 0.017 0.017 0.017 0.017 0.009 0.017 0.017 0.017 0.009 0.017 0.017 0.026 0.009 0.017 0.017 0.017 0.009 0.009 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.009 0.017 0.009 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.009 0.017 0.017 0.017 0.009 0.009 0.017 0.009 0.017 0.017 0.009 0.026 0.017 0.009 0.009 0.017 0.017 0.017 0.017 0.017 0.009 0.017 0.017 0.009 0.017 0.017 0.017 0.017 0.017 0.009 0.017 0.009 0.009 0.017 0.009 0.017 0.017 0.017 0.017 0.017 0.017 0.009 0.017 0.017 0.026 0.017 0.017 0.009 0.017 0.026 0.017 0.009 0.009 0.009 0.017 0.017 0.026 0.017 0.017 0.009 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.009 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.009 0.017 0.009 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.009 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.009 0.009 0.017 0.017 0.017 0.017 0.017 0.017 0.009 0.017 0.017 0.009 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.009 0.017 0.017 0.017 0.017 0.009 0.017 0.017 0.009 0.009 0.017 0.017 0.009 0.017 0.009 0.017 0.017 0.017 0.017 0.009 0.017 0.009 0.017 0.017 0.017 0.017 0.009 0.017 0.017 0.017 0.017 0.017 0.009 0.017 0.017 0.017 0.017 0.017 0.009 0.017 0.017 0.017 0.009 0.017 0.009 0.017 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.017 0.009 0.009 0.017 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.017 0.017 0.017 0.017 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.017 0.017 0.017 0.017 0.009 0.017 0.009 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.009 0.009 0.009 0.017 0.017 0.017 0.009 0.009 0.017 0.009 0.017 0.017 0.017 0.017 0.017 0.009 0.009 0.017 0.009 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.009 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.009 0.017 0.009 0.017 0.017 0.017 0.017 0.026 0.017 0.017 0.017 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.017 0.009 0.009 0.017 0.009 0.017 0.017 0.017 0.017 0.009 0.009 0.017 0.017 0.017 0.009 0.009 0.017 0.017 0.017 0.017 0.017 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.017 0.009 0.009 0.017 0.017 0.017 0.017 0.009 0.017 0.017 0.026 0.017 0.017 0.017 0.009 0.017 0.017 0.017 0.017 0.009 0.017 0.017 0.009 0.009 0.017 0.017 0.017 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.017 0.009 0.009 0.017 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.017 0.017 0.017 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.017 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.017 0.017 0.017 0.017 0.017 0.009 0.017 0.009 0.009 0.009 0.017 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.009 0.009 0.009 0.009 0.017 0.017 0.017 0.009 0.009 0.017 0.009 0.017 0.009 0.017 0.017 0.017 0.017 0.009 0.009 0.017 0.017 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.017 0.009 0.017 0.009 0.009 0.009 0.009 0.017 0.009 0.017 0.017 0.017 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.017 0.017 0.017 0.017 0.017 0.017 0.009 0.017 0.009 0.009 0.009 0.017 0.009 0.017 0.026 0.026 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.026 0.009 0.009 0.017 0.017 0.017 0.017 0.009 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.026 0.026 0.017 0.017 0.017 0.017 0.017 0.017 0.009 0.017 0.017 0.009 0.017 0.017 0.017 0.026 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.017 0.017 0.009 0.017 0.009 0.009 0.017 0.017 0.017 0.017 0.026 0.009 0.009 0.009 0.017 0.017 0.017 0.017 0.009 0.009 0.009 0.017 0.017 0.017 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.017 0.009 0.017 0.017 0.009 0.009 0.009 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.009 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.009 0.017 0.017 0.009 0.017 0.017 0.009 0.017 0.017 0.009 0.009 0.017 0.009 0.017 0.017 0.017 0.009 0.017 0.017 0.017 0.017 0.009 0.017 0.009 0.009 0.017 0.017 0.009 0.009 0.017 0.009 0.009 0.009 0.017 0.017 0.017 0.009 0.009 0.009 0.017 0.017 0.017 0.009 0.017 0.009 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.009 0.017 0.017 0.009 0.017 0.017 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.017 0.009 0.017 0.017 0.009 0.009 0.009 0.017 0.017 0.017 0.009 0.017 0.017 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.000 0.017 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.000 0.009 0.009 0.009 0.017 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.017 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.017 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.017 0.017 0.009 0.017 0.009 0.009 0.009 0.009 0.017 0.017 0.017 0.017 0.017 0.009 0.017 0.017 0.017 0.017 0.009 0.009 0.009 0.017 0.140 0.314 0.227 0.201 0.262 0.331 0.314 0.209 0.262 0.209 0.236 0.288 0.209 0.218 0.166 0.201 0.201 0.218 0.157 0.236 0.244 0.227 0.201 0.131 0.105 0.017 0.017 0.009 0.009 0.009 0.017 0.009 0.017 0.009 0.009 0.017 0.009 0.017 0.017 0.017 0.017 0.017 0.009 0.009 0.009 0.017 0.017 0.017];
oh2L3=[0.017 0.017 0.017 0.017 0.026 0.017 0.009 0.017 0.017 0.017 0.017 0.017 0.026 0.017 0.017 0.026 0.026 0.017 0.017 0.009 0.017 0.017 0.017 0.009 0.017 0.009 0.017 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.017 0.009 0.017 0.017 0.009 0.017 0.009 0.009 0.017 0.017 0.017 0.017 0.009 0.017 0.017 0.009 0.017 0.009 0.017 0.009 0.017 0.009 0.009 0.017 0.009 0.009 0.017 0.017 0.017 0.009 0.017 0.017 0.009 0.017 0.009 0.017 0.009 0.009 0.009 0.017 0.017 0.017 0.017 0.009 0.017 0.017 0.009 0.009 0.009 0.017 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.017 0.009 0.009 0.017 0.009 0.017 0.017 0.017 0.009 0.017 0.017 0.017 0.017 0.009 0.017 0.017 0.009 0.017 0.009 0.017 0.017 0.009 0.009 0.017 0.017 0.017 0.017 0.009 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.009 0.017 0.026 0.017 0.017 0.017 0.009 0.017 0.017 0.017 0.017 0.009 0.009 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.009 0.009 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.009 0.017 0.017 0.017 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.009 0.017 0.009 0.017 0.017 0.017 0.017 0.017 0.017 0.017 0.009 0.017 0.017 0.009 0.017 0.017 0.017 0.009 0.017 0.009 0.009 0.017 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.017 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.017 0.009 0.017 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.017 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.017 0.017 0.017 0.017 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.017 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.017 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.017 0.017 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.017 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.017 0.017 0.009 0.009 0.017 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.122 0.262 0.209 0.157 0.209 0.262 0.253 0.166 0.209 0.174 0.192 0.218 0.166 0.174 0.140 0.157 0.174 0.183 0.122 0.192 0.201 0.192 0.166 0.113 0.087 0.009 0.009 0.009 0.009 0.017 0.017 0.017 0.017 0.017 0.009 0.009 0.009 0.017 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.017 0.017 0.026];
oh2=[oh2L1, oh2L2, oh2L3];
oh2sorted=sort(oh2,'ascend');
y2= cdf(pd,oh2sorted)
plot(oh2sorted,y2)
The problem is that the chart shows that function doesn't work correctly. For example - i have only two data (from 3024) in vector = 0, but for oh2=0 chart display y(x=0)=0.
Where is the problem?

2 Kommentare

What distribution (and parameters) does ‘pd’ represent?
pd = makedist('Normal')
I accidentally didn't copy this to question.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Star Strider
Star Strider am 13 Dez. 2020
Bearbeitet: Star Strider am 13 Dez. 2020
The code is working correctly. All the values in ‘oh2’ are extremely small and close together, and there are only 29 unique values in it:
Uoh2sorted = unique(oh2sorted)
producing a vector going from 0 to 0.331.
EDIT — (13 Dec 2020 at 17:20)
To appreciate it in a larger context, run this:
y2= cdf(pd,oh2sorted);
plot(oh2sorted,y2)
yv = -3:0.1:3;
ycdf = cdf(pd, yv);
figure
plot(yv, ycdf)
hold on
plot(oh2sorted,y2, '+r')
hold off
grid
Your data are plotted as red ‘+’ signs.

10 Kommentare

What do unique values change?
This is cumulative distribution, so the last data should always be = 100%. Shouldn't I get the chart looking like this?
Ok, I understand that I have small values. But why I don't get the main shape of chart looking like in the picture in previous comment? I thought that it is the result of 'cumulative distribuation' definition.
If you run my code example that I posted in the EDIT, you get this result:
Your data are the red ‘+’ in the plot.
Yes, I understand. Does it means that this function is basing on the unique values, instead of all data?
It is using all the data, however there are only 29 unique values, so it overplots many of them.
Is there any solution to increase number of unique values?
Maybe I show what I want to get:
I have more data that oh2: oh3, oh4, oh5 itd.
Max value is 1.6.
I get something like this:
Where I need to get something like this:
So i need more unique values to get chart where values on yaxsis are from 0 to 1?
Aleksandra Pawlak
Aleksandra Pawlak am 13 Dez. 2020
Bearbeitet: Aleksandra Pawlak am 13 Dez. 2020
I mean that for example when for oh2 I have 2x 0 from 3084 data- so the probability of get 0 is around 0,06%. In my chart it is around 50%. So this is why i think it works bad.
I have 0 in unique values.
You defined ‘pd’ as a normal distribution with a mean of 0 and a standard deviation of 1, the default parameters in the way you defined it:
pd = makedist('Normal')
if you want to define it with respect to your data, try this:
pd = makedist('Normal', 'mu',mean(oh2), 'sigma',std(oh2));
y2= cdf(pd,oh2sorted);
plot(oh2sorted,y2)
yv = linspace(-0.15, 0.15);
ycdf = cdf(pd, yv);
figure
plot(yv, ycdf)
hold on
plot(oh2sorted,y2, '+r')
hold off
grid
I have no idea what you are doing. Make appropriate changes to get the result you want.
Also, I am not certain how to interpret ‘... the probability of get 0 is around 0,06%’ since I am now confused as to whether you want a cumulative distribution function or a probability density function.
The pdf is given as:
pd = makedist('Normal', 'mu',mean(oh2), 'sigma',std(oh2));
y2= pdf(pd,oh2sorted);
plot(oh2sorted,y2)
yv = linspace(-0.15, 0.15);
ypdf = pdf(pd, yv);
figure
plot(yv, ypdf)
hold on
plot(oh2sorted,y2, '+r')
hold off
grid
I will let you sort that.

Melden Sie sich an, um zu kommentieren.

Gefragt:

am 13 Dez. 2020

Kommentiert:

am 13 Dez. 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by