Effacer les filtres
Effacer les filtres

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

3 vues (au cours des 30 derniers jours)
parslee
parslee le 17 Mar 2022
Commenté : parslee le 17 Mar 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 commentaires
Torsten
Torsten le 17 Mar 2022
And what are the corresponding x-values to the y-values in the columns ?
parslee
parslee le 17 Mar 2022
x is 1 to 257 for all of them

Connectez-vous pour commenter.

Réponse acceptée

David Hill
David Hill le 17 Mar 2022
for k=1:36
B{k}=fit((1:257)',A(:,k),'exp1');
end
  5 commentaires
Torsten
Torsten le 17 Mar 2022
Modifié(e) : Torsten le 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
parslee
parslee le 17 Mar 2022
Thank you!!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Fit Postprocessing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by