function f = nexponential(parameters, x)

% Determine number of exponentials.
N = length(parameters)/2;

% Unpack parameters.
A = parameters(1:N);
tau = parameters(N+1:end);

% Compute function values.
f = x * 0.0;
for i = 1:length(x)
  for k = 1:N
    f(i) = f(i) + A(k) * exp(-x(i) / tau(k));
  end
end

return
