필터 지우기
필터 지우기

Get array from a function

조회 수: 4 (최근 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 CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by