Requires a vector second input argument.

8 Ansichten (letzte 30 Tage)
Ashkan Rigi
Ashkan Rigi am 29 Okt. 2021
Kommentiert: Matt J am 29 Okt. 2021
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 Kommentar
Matt J
Matt J am 29 Okt. 2021
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)

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by