Hi,
It appears you want to find the maximum area of a rectangle with sides A and B, such that A + B = Lt. This would assume that Lt is the semi perimeter of the shape. Regardless, this will not effect the Optimization variable x, but you may want to modify the code below, as if Lt is the perimeter, A = (Lt*x)/2 and B = Lt/2 - A
% range of x - from 0 to 1, as sides can have
x1 = 0;
x2 = 1;
%Semi perimeter = 10
Lt = 10;
%x is optimization variable
[x_max , val] = fminbnd(@(x) -(Lt*x)*(Lt-Lt*x),x1,x2);
%val is minimum
val = -val;