Requires a vector second input argument.

조회 수: 8 (최근 30일)
Ashkan Rigi
Ashkan Rigi 2021년 10월 29일
댓글: Matt J 2021년 10월 29일
hi. I run the code below and got the error " Requires a vector second input argument."
t=0:.1:pi;
y=sin(t);
modelfun = @(b,x)(b(1).*x.^3+b(2).*x.^2+b(3).*x+b(4));
b = [-.161;1;1;1];
y = modelfun(b,x) + normrnd(0,0.1,32,1);
beta0 = [2;2;2];
beta = @(predictor,response)nlinfit(predictor,response,modelfun,beta0)
ci = bootci(1000,beta,t,y)
  댓글 수: 1
Matt J
Matt J 2021년 10월 29일
That's not the error that I get:
t=0:.1:pi;
y=sin(t);
modelfun = @(b,x)(b(1).*x.^3+b(2).*x.^2+b(3).*x+b(4));
b = [-.161;1;1;1];
y = modelfun(b,x) + normrnd(0,0.1,32,1);
Unrecognized function or variable 'x'.
beta0 = [2;2;2];
beta = @(predictor,response)nlinfit(predictor,response,modelfun,beta0)
ci = bootci(1000,beta,t,y)

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Nonlinear Regression에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by