% Define the functionf = @(x) x^2 - 6*x + 4;
% Define the interval [a,b] (initial guesses for the root)a = 0;
b = 3;
% Set the tolerance leveltol = 1e-6;
% Set the maximum number of iterationsmax_iter = 1000;
% Implement the Regula Falsi methodfori = 1:max_iter
c = (a*f(b) - b*f(a)) / (f(b) - f(a));
if f(c) == 0 || (b-a) < tol
disp('Root found at:');
disp(c);
break;
endif f(c)*f(a) < 0 b = c;
else a = c;
endend