MATLAB: How to find the optimal values of inputs when outputs have constraints in optimization

constraints given to outputoptimization

I have the following functions
L=sqrt((x(1)^2)+(x(2)^2)+(x(3)^2))+sqrt((x(4)^2)+(x(5)^2)+(x(6)^2));
H=x(7);
alpha=atand((x(1)-x(8))/x(2));
beta=atand(x(3)/x(2));
how to find the optimal values of x(1),x(2),x(3),x(4),x(5),x(6),x(7),x(8) such that output having constraints as 170<L<190,20<H<30,1<alpha<2,2<beta<4

Best Answer

Use fmincon. See Writing Scalar Objective Functions and Constraints for instructions on formulating your objective function and constraints in fmincon syntax.
Alan Weiss
MATLAB mathematical toolbox documentation