feval for beginner, evaluating a function at a specific fvalue
이전 댓글 표시
how do I evaluate the following function at 55/8, 9/2? I keep getting feval errors saying I need a string or handle. Any help?
>> c
c =
55/8
9/2
>> f
f =
- 4*q1^2 + 55*q1 - 15*q2^2 + 135*q2 - 100
>> y=feval(f,c)
Error using feval
Argument must contain a string or function_handle.
채택된 답변
추가 답변 (1개)
Adam
2015년 4월 15일
f should be a function handle or the name of an actual function, not a string containing a raw function. Just convert your function to a function handle e.g.
f = @(q1,q2) - 4*q1^2 + 55*q1 - 15*q2^2 + 135*q2 - 100
카테고리
도움말 센터 및 File Exchange에서 Desktop에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!