%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Secant Method %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function q = secant(x0, x1, n) for i = 0:n x2 = x0 - ((f(x0)*(x0 - x1))/(f(x0) - f(x1))); x0 = x1; x1 = x2; if((f(x0) - f(x1)) == 0) break end end q = x2; fprintf(1,'The solution is %16.10f\n',q)