Get array from a function

2 Ansichten (letzte 30 Tage)
TTA
TTA am 15 Dez. 2022
Verschoben: Walter Roberson am 15 Dez. 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

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 15 Dez. 2022
Verschoben: Walter Roberson am 15 Dez. 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.

Weitere Antworten (0)

Kategorien

Mehr zu Signal Integrity Kits for Industry Standards finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by