How can I calculate the median in a gamma distribution?

Solution 1:

User TwistedSim answered my question.

You need to find the value m for which the integral from 0 to m give you 0.5. You can do that with c = cumsum(f)*dx where dx = 0.01 in your case. After it's just a matter of using find(c>0.5, 1, 'first').