function R = meanlines(X, lines) Y = lines(:,1) * X + lines(:,2); R = mean(Y);