Error inside of function using feval on user-provided polynomial

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 件のコメント

Walter Roberson
Walter Roberson 2019 年 10 月 13 日
What are you passing to bisect()?
Tejaswini Veduruvada
Tejaswini Veduruvada 2020 年 3 月 18 日
Can you specify what input arguments are passed to that function with syntax ?

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

製品

質問済み:

2019 年 10 月 13 日

Community Treasure Hunt

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

Start Hunting!

Translated by