Get array from a function

11 ビュー (過去 30 日間)
TTA
TTA 2022 年 12 月 15 日
移動済み: Walter Roberson 2022 年 12 月 15 日
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

採用された回答

Walter Roberson
Walter Roberson 2022 年 12 月 15 日
移動済み: Walter Roberson 2022 年 12 月 15 日
[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 件のコメント
TTA
TTA 2022 年 12 月 15 日
移動済み: Walter Roberson 2022 年 12 月 15 日

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by