Plotting Bisection intervals code

1 回表示 (過去 30 日間)
gracias claude
gracias claude 2021 年 2 月 13 日
編集済み: gracias claude 2021 年 2 月 13 日
Looking for where I plot the intervals on a `plot()` and where ?
function [x,e] = MyBisectFunc(f, a1,b1, number)
format long
c1 = f(a1); d1 = f(b1);
if c1*d1 > 0.0
error ('Func has same sign at both endpoints')
end
for i = 1:number
x = (a1 + b1) /2;
y = f(x);
disp([x,y])
% tried this but nothing showed up on the graph
plot(x,y)
if abs(y) < 10^-8
break
end
if c1*y < 0
b1 = x;
else
a1 = x;
end
end
x = (a1 + b1)/2;
e = (b1 - a1) /2;

回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by