determine the values of 2 unknowns through nonlinear regression and predict value of equation

조회 수: 2(최근 30일)
Opariuc Andrei
Opariuc Andrei 2020년 12월 6일
편집: Opariuc Andrei 2020년 12월 6일
I have to determine the value of 2 unknowns a and b through nonlinear regression and predict the value of the equation y for x=2.6
the equation is y=((a+sqrt(x)./(b.*sqrt(x))).^2). i looked through my class pdf's and i found nothing related to non linear regression and searched on youtube found nothing helpful . Any clues please ? or links to helpful locations websites or mathworks that might contain info . I don't know where to search anymore .
  댓글 수: 3
Ameer Hamza
Ameer Hamza 2020년 12월 6일
For this equation, the correct is
y=((a+sqrt(x))./(b.*sqrt(x))).^2

댓글을 달려면 로그인하십시오.

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 12월 6일
There are several ways to do nonlinear regression for a given model in MATLAB. If you have the optimization toolbox, then you can use lsqcurvefit(): https://www.mathworks.com/help/releases/R2020a/optim/ug/lsqcurvefit.html or lsqnonlin(): https://www.mathworks.com/help/releases/R2020a/optim/ug/lsqnonlin.html
fit(): https://www.mathworks.com/help/releases/R2020a/curvefit/fit.html from Curve fitting toolbox can also be used.
  댓글 수: 1
Opariuc Andrei
Opariuc Andrei 2020년 12월 6일
i'm stuck ,what am i doing wrong ?
.x=2.6;
y=@(a,b)((a+sqrt(x))./(b.*sqrt(x))).^2;
%% calculus
[a,b,y]=lsqnonlin(y,x)

댓글을 달려면 로그인하십시오.

추가 답변(0개)

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by