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
Star Strider
2015년 12월 19일
What code did you use to call your function?
답변 (1개)
Andrei Bobrov
2015년 12월 19일
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)
댓글 수: 0
이 질문은 마감되었습니다.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!