Filter löschen
Filter löschen

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

3 Ansichten (letzte 30 Tage)
parslee
parslee am 17 Mär. 2022
Kommentiert: parslee am 17 Mär. 2022
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?
  2 Kommentare
Torsten
Torsten am 17 Mär. 2022
And what are the corresponding x-values to the y-values in the columns ?
parslee
parslee am 17 Mär. 2022
x is 1 to 257 for all of them

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

David Hill
David Hill am 17 Mär. 2022
for k=1:36
B{k}=fit((1:257)',A(:,k),'exp1');
end
  5 Kommentare
Torsten
Torsten am 17 Mär. 2022
Bearbeitet: Torsten am 17 Mär. 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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by