I think that the use of 'interior-point' algorithm solves my problem. If the program is feasible, it gives proper solution. For infeasible program, the code gives weird output but I can check exitflag to know that it is infeasible.
Thanks a lot for all the help. I really appreciate it. I may reply here again if I get stuck in fmincon again.
"Matt J" wrote in message <firstname.lastname@example.org>... > "Nazmul Islam" wrote in message <email@example.com>... > > > > I have not set the 'AlwaysHonorConstraints' option. It is probably set to the default value. > ===================== > > Then you should turn it on (it's off by default). > > > > Some constraints of c(i) are off by as large AS 10 or 2000 ! So, it's not coming from the round-off error, I guess. > ================ > > Check the exitflag to see if the algorithm stopped prematurely.