function beam_opt_class x0 = 0.1*ones(2,1); options = optimset('Display','iter','MaxIter',100,'MaxFunEvals',500,'LargeScale','off'); A = []; b = []; Aeq = []; beq = []; lb = ones(2,1); ub = []; x = fmincon(@cost,x0,A,b,Aeq,beq,lb,ub,@constraints,options) function f = cost(x) x1 = x(1,1); x2 = x(2,1); f = 8.46*x1*x2; function [c,ceq] = constraints(x) x1 = x(1,1); x2 = x(2,1); c(1,1) = (3.6/(x1^3*x2))-1.0; c(2,1) = (9/(x1^2*x2))-1.0; ceq = [];