function w = modexptr(y)

%MODEXPTR Computes parameters a,b,c of modified exponential trend of
%       time series y. Modified exponencial trend is trend of form
%       y = c + a*b^t, where b>0, t = 1,...,n. Function returns vector
%       w, which is c + a*b^t.

[m,n] = size(y);
z = modexpcf(y);
if m == 1
        t = [1:n];
        w = z(3) + z(1)*(z(2).^t);
else
        for k = 1:n
                w = [w,(modexptr(y(:,k)'))'];
        end
end
