Undefined function 'eval' for input arguments of type 'double'.
조회 수: 2 (최근 30일)
이전 댓글 표시
When using the code below:
function [Df]=difc(f,u,h)
syms x
x=u+h; lp=eval(f);
x=u-h; ll=eval(f);
Df=(lp-ll)/(2*h);
end
, the same error keeps appearing ''Undefined function 'eval' for input arguments of type 'double'.''
I would like to know what´s the problem and what can I do to solve it, in order to have a working code.
Thankyou very much
댓글 수: 2
Walter Roberson
2012년 11월 8일
What are you passing in to the function?
Note: your assignments to "x" are undoing the effect of "syms x".
채택된 답변
C.J. Harris
2012년 11월 8일
You are getting that error because you are trying to evaluate a double. A double is just a double - there is nothing there to evaluate.
What are you expecting the 'eval' function to do?
댓글 수: 2
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!