I don't untersantd the following error:

??? 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 Kommentar

Star Strider
Star Strider am 19 Dez. 2015
What code did you use to call your function?

Antworten (1)

Andrei Bobrov
Andrei Bobrov am 19 Dez. 2015

1 Stimme

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)

Diese Frage ist geschlossen.

Gefragt:

am 19 Dez. 2015

Geschlossen:

am 20 Aug. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by