% Define parameters
a = 1; 
b = 4;
tol = 1e-6;
imax = 50;

% Call the bisection method
root = bisect(@func1, a, b, imax, tol);

% Plot the function and the root
x = linspace(a, b, 1000);
y = func1(x);

figure;
plot(x, y, '-b', root, func1(root), 'ro');
title(['Root at x = ', num2str(root)]);
xlabel('x');
ylabel('f(x)');
grid on;