Plotting Bisection intervals code

1 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 2-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