Mercurial > hg > medcouple
view slowmedcouple.m @ 54:bb6e5cf6aa83
plots: add geometric data
author | Jordi Gutiérrez Hermoso <jordigh@octave.org> |
---|---|
date | Mon, 16 May 2016 22:29:33 -0400 |
parents | 2de6dcb8e9c2 |
children |
line wrap: on
line source
function mc = slowmedcouple(z) n = length(z); n2 = ceil(n/2); z = sort(z, "descend"); zmed = median(z); z -= zmed; zplus = z(z >= 0); zminus = z(z <= 0)'; zz = (zplus + zminus)./(zplus - zminus); zz(isnan(zz)) = 0; zzsort = sort(zz(:), "descend"); medc_idx = ceil(n2^2/2); mc = zzsort(medc_idx); printf("%.16g\n", mc); endfunction