Error inside of function using feval on user-provided polynomial
Show older comments
Hi all, I am having an issue with my code and I can't figure it out for the life of me. Here's my code:
function [l,r,nf] = bisect(fname,a,b,tol)
if(a == b)
if(feval(fname,a) == 0)
l = a;
r = l;
nf = 0;
return;
else
l = NaN;
r = l;
nf = -1;
return;
end
end
The error message states:
Error using feval
Function to evaluate must be represented as a string scalar, character vector, or function_handle object.
Error in bisect (line 26)
if(feval(fname,a) == 0).
Can anyone point me in the right direction? Help would be so much appreciated.
2 Comments
Walter Roberson
on 13 Oct 2019
What are you passing to bisect()?
Tejaswini Veduruvada
on 18 Mar 2020
Can you specify what input arguments are passed to that function with syntax ?
Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!