Get array from a function
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
TTA
le 15 Déc 2022
Déplacé(e) : Walter Roberson
le 15 Déc 2022
I have this matlab code below and the result is attached.
please I need to get the red line in the attached figure in a form of array
[x, y] = titanium;
gEqn = 'a*exp(-((x-b)/c)^2)+d';
startPoints = [1.5 900 10 0.6];
[fj,gof,output] = fit(x',y',gEqn,'Start', startPoints, 'Exclude', [1 10 25]);
plot(fj,x,y)
Thanks
0 commentaires
Réponse acceptée
Walter Roberson
le 15 Déc 2022
Déplacé(e) : Walter Roberson
le 15 Déc 2022
[x, y] = titanium;
gEqn = 'a*exp(-((x-b)/c)^2)+d';
startPoints = [1.5 900 10 0.6];
[fj,gof,output] = fit(x',y',gEqn,'Start', startPoints, 'Exclude', [1 10 25]);
xmin = min(x);
xmax = max(x);
NumberOfPoints = 250;
xfit = linspace(xmin, xmax, NumberOfPoints);
yfit = fj(xfit);
That is, if you use the cfit object as-if it is a function, then it accepts values of the independent variable and returns corresponding fitted values.
1 commentaire
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Signal Integrity Kits for Industry Standards 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!