g = 9.81;
t0 = 0.872664626;
y0 = 1;
v0 = 25;
y = @(x) -1*((tan(t0))*x - ((g)/((2*(v0^2))*(cos(t0))^2))*x^2 + y0);

x = golden(-100, 100, y);

val = (tan(t0))*x - ((g)/((2*(v0^2))*(cos(t0))^2))*x^2 + y0;

clc

disp(['The maximum height is at: ',num2str(val), ' and it is: ', num2str(x)]);