Not enough input arguments with fminunc
1 view (last 30 days)
Show older comments
Yasin Simsek
on 5 Jun 2019
Commented: Yasin Simsek
on 5 Jun 2019
I wrote the followng code
global y t;
y = [1 2 4 6 4 12 11 13 11 14 16 17]';
T = length(y);
t = [1:T]';
x0 = [0, 0];
x = fminunc(@ssr, x0);
and function
function val = ssr(a, b)
global y t;
val = (y - a - b*t)'*(y - a - b*t);
end
when I run the code I get not enpugh input arguments error. I do not understand the reason. Could you help?
0 Comments
Accepted Answer
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!