Undefined function or variable 'bisection'.
古いコメントを表示
function [x,e] = mybisect (f,a,b,n)
c = f(a);
z = f(b);
if (f(a)*f(b) > 0)
error ('Function has ame sign at both endpoints')
end
disp(' x y')
for i = 1:n
x = (a+b)/2;
y = f(x);
disp([ x y])
if y == 0.0
a = x;
b = x;
break
end
if c.y < 0.0
b = x;
else
a = x;
end
end
x = (a+b)/2;
e = (b-a)/2;
end
回答 (1 件)
James Tursa
2021 年 3 月 15 日
編集済み: James Tursa
2021 年 3 月 15 日
0 投票
From the error message, it looks like you are calling the function using the name "bisection", but the actual name of the function is "mybisect". Hence the error.
カテゴリ
ヘルプ センター および File Exchange で MATLAB についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!