for i = (1:length(B)) p = B(i); if p < 0 j(:,i)=p; end end f = sum(j)/120000 sum(GW)/120000