How to fit an exponential curve for every column in a matrix?

3 views (last 30 days)
I have a matrix of 257x36 and each column represents a different data set.
I need to apply an exponential fit to each column and also store the fit values.
How can I go about doing this?

Accepted Answer

David Hill
David Hill on 17 Mar 2022
for k=1:36
B{k}=fit((1:257)',A(:,k),'exp1');
end
  5 Comments
Torsten
Torsten on 17 Mar 2022
Edited: Torsten on 17 Mar 2022
for k=1:36
B{k} = fit((1:257)',A(:,k),'exp1');
coeffs = coeffvalues(B{k});
Ahat(:,k) = coeffs(1)*exp(coeffs(2)*(1:257).');
end

Sign in to comment.

More Answers (0)

Categories

Find more on Linear and Nonlinear Regression in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!