function [centroids] = getCentroids( Vmaxs )

isMaxCh2=(Vmaxs(:,2)>Vmaxs(:,1)).*(Vmaxs(:,2)>Vmaxs(:,3));

VmaxsMaxonCH2=Vmaxs(logical(isMaxCh2),:);

centroids= (VmaxsMaxonCH2(:,1)+2*VmaxsMaxonCH2(:,2)+3*VmaxsMaxonCH2(:,3))./((VmaxsMaxonCH2(:,1)+VmaxsMaxonCH2(:,2)+VmaxsMaxonCH2(:,3)));

