Borrar filtros
Borrar filtros

Get array from a function

4 visualizaciones (últimos 30 días)
TTA
TTA el 15 de Dic. de 2022
Movida: Walter Roberson el 15 de Dic. de 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

Respuesta aceptada

Walter Roberson
Walter Roberson el 15 de Dic. de 2022
Movida: Walter Roberson el 15 de Dic. de 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.

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by