MATLAB: I want to maximize a non linear function

non-linear optimizationoptimizationOptimization Toolbox

I have a function of two variables and I need to maximise it for given constraints. The function: F(x) = x1 / (x2 * constant) subject to: 20000 <= x1 <= 50000, 1 <= x2 <= 5
Kindly guide me how to do this using MATLAB.
Regards Abubakr

Best Answer

The constant does not change the relative position of the maximum.
The expression over positives (or if both are negative) x1/x2 always has its maximum when x1 is as far from 0 as the range permits, and x2 is as close to 0 as the range permits.
You do not need to run an optimization, just choose the upper bound of x1 and the lower bound of x2