MATLAB: Minimising non linear function

fminconlsqrt

I have a non linear function with 3 variables and 4 linear constraint inequalities. I want get values of three variables with minimizing non linear function using Least square method.
creating function file
function f=objfun(x)
%%%longitudinal velocities %%%
rho=8.96e-3;
voigtl=sqrt((((x(1)+2*x(2))/3)+((4/15)*(x(1)-x(2)+3*x(3))))/rho);
reussl=sqrt((((x(1)+2*x(2))/3)+((4/3)*(5*x(3)*(x(1)-x(2))/(3*(x(1)-x(2))+4*x(3)))))/rho);
velham=(voigtl+reussl)/2;%%longitudinal velocity as per Hill criterion in arithmetic mean
velhgm=sqrt(voigtl*reussl);%%longitudinal velocity as per Hill criterion in geometric mean
velexp=4854; %%experimentally measured velocity
f=((velham)^2-(velexp)^2)/(velexp)^2;
end
creating contraints
function [c, ceq] = confun(x) % Nonlinear inequality constraints
c = [-x(1)-2*x(2); -x(3);-x(1)+x(2);((x(1)-x(2))/2)-x(3)]; % Nonlinear equality constraints

% Nonlinear equality constraints
ceq = [];
end
minimizing function used
x0 = [1,1,1]; % Make a starting guess at the solution
options = optimset('TolFun',1e-10,'MaxIter',4000);
% A=[-1,-2,0; 0,0,-1; -1,1,0; 1/2,-1/2,-1;];
% b=[0,0,0,0];
lb=[50,50,50];
ub=[];
[x,fval,iterations] = quadprog(@objfun,x0,[],[],[],[],[],[],@confun,options);

Best Answer

So what is your question? You have stated what you want. Did this not work?
Ok, so I do wonder why you are trying to use the wrong tool for the problem. After all, quadprog does not handle general nonlinear programming problems, subject to general nonlinear inequality constraints. So your problem, whatever it might be might be as simple as reading the help for the tool and realizing that your call is meaningless in that context.
There are other things. For example, you define a set of lower bounds, but then never pass them in. MATLAB cannot read your mind.
My guess is you need to use fmincon. (Properly! Read the help.) But the crystal ball is so foggy. I just cannot read your mind either.
Related Question