view slowmedcouple.m @ 37:4fb3b87b8610

Add GPL'ed header
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Mon, 06 Apr 2015 08:43:43 -0400
parents d9230d702fbf
children 2de6dcb8e9c2
line wrap: on
line source

z = load("rand53");
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);