I don't untersantd the following error:
Info
This question is closed. Reopen it to edit or answer.
Show older comments
??? Input argument "a" is undefined.
Error in ==> primeira at 3
f =(-3-a-b)^2 + ( -1.89-a-b*exp(0.5*c) )^2 + (-1.03 - a- b*exp(c))^2 + (-0.36-a-b*exp(1.5*c))^2 + (0.16-a-b*exp(2*c))^2 + (0.57-a-b*exp(2.5*c))^2 +
(0.88-a-b*exp(3*c))^2 ;
My function is:
function [F ] =primeira (a,b,c)
f =(-3-a-b)^2 + ( -1.89-a-b*exp(0.5*c) )^2 + (-1.03 - a- b*exp(c))^2 + (-0.36-a-b*exp(1.5*c))^2 + (0.16-a-b*exp(2*c))^2 + (0.57-a-b*exp(2.5*c))^2 + (0.88-a-b*exp(3*c))^2 ;
F= [diff(f,a) ; diff(f,b) ; diff(f,c) ];
end
1 Comment
Star Strider
on 19 Dec 2015
What code did you use to call your function?
Answers (1)
Andrei Bobrov
on 19 Dec 2015
syms a b c
f =(-3-a-b)^2 + ( -1.89-a-b*exp(0.5*c) )^2 + (-1.03 - a- b*exp(c))^2 ...
+ (-0.36-a-b*exp(1.5*c))^2 + (0.16-a-b*exp(2*c))^2 + (0.57-a-b*exp(2.5*c))^2 + (0.88-a-b*exp(3*c))^2 ;
df = jacobian(f,[a,b,c])
dfun = matlabFunction(df)
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!