필터 지우기
필터 지우기

Best Cubic Polynomial fitting

조회 수: 2 (최근 30일)
Naresh Pati
Naresh Pati 2019년 1월 22일
답변: Torsten 2019년 1월 22일
I have a data set (a versus b, see the attached file and the attached figure). fig1.png I want to find the coefficients p and q of the cubic polynomial b=p*a+q*a^3 that fits the data. Please help.

답변 (1개)

Torsten
Torsten 2019년 1월 22일
mat = [a a.^3];
rhs = b;
sol = mat\rhs;
p = sol(1)
q = sol(2)
fun=@(x) p*x + q*x.^3;
bb = fun(a);
plot(a,b,a,bb)

카테고리

Help CenterFile Exchange에서 Get Started with Curve Fitting Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by