function Burke_FP()clearclct1 = input('Please input your upper bounds')f1 = myfunc(t1);t2 = input('Please input your lower bounds')f2 = myfunc(t2);t = linspace (t1,t2,100);error = 10;f = myfunc(t);plot(t,f)while error > 1e-4 tr = t2 - f2*(t1 - t2)/(f1-f2); fr = myfunc(tr); if sign(fr) == f1 t1 = tr; f1 = fr; else t2 = tr; f2 = fr; end %recompute error
error = abs(fr); end tr endfunction out = myfunc(in)in.^2-5end
MATLAB: I cannot get this to work…I keep getting errors all over the place. Could someone kindly explain
false-position
Best Answer