How to add a constraint function to lsqnonlin
    조회 수: 3 (최근 30일)
  
       이전 댓글 표시
    
Hello, users.
I'm using Matlab and optimizaiton toolbox to find matrix x. (Please see figure attached.)
Matrix A is m*n matrix which has fixed values and matrix B is output.
I used fmincon to find matrix x when B has (almost) identical values. For this work "fun" is a function of minimizing standard deviation.
At that time I was able to use nonlcon for the condition that maximum x value is smaller than two times of minimum value. (xmax <= 2*xmin)
x = fmincon(fun,x0,A,b,Aeq,beq,lb,ub,nonlcon,options)
But when matrix B has different values, I know I cannot use fmincon anymore.
I'm trying to use lsqnonlin but it does not support constraint function.
x = lsqnonlin(fun,x0,lb,ub,options)
After numerical optimization, there is too big difference maximum value and minimum value. (xmax > 10000*xmin, it's not realistic value.)
Question. Can I get some matlab tip for this work? I mean I want to check if there is some user-subroutine or something other way to handle this.
Thanks in advance.

댓글 수: 1
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

