Function:
f(x)=x2+2x-5
Graphics


MATLAB CODE
clc
close all
clear all
x=-10:10;
y=x.^2+2*x-5;
plot(x,y,'--k')
grid on
xlabel('x');
ylabel('y');
legend('y=x.^2+2*x-5');
title('y=x.^2+2*x-5');
[x1, y] = fzero('x.^2+2*x-5', -5)
[x2, y] = fzero('x.^2+2*x-5', 0)
x1 = -3.4495 x2 = 1.4495 is roots