function [y] = Lorentz_xN_Func(n, v, x)

background = v(1)/n;

%Read parameters. Order: amplitude, center, width
amplitude = zeros(n,1);
center = zeros(n,1);
width = zeros(n,1);
for i=1:n
    amplitude(i) = v(2+3*(i-1));
    center(i) = v(3+3*(i-1));
    width(i) = v(4+3*(i-1));
end

y = 0;
for i=1:n
    y = y+LorentzFunc([background,amplitude(i),center(i),width(i)], x);
end

end