Absolute Value in optimization expression
조회 수: 8 (최근 30일)
이전 댓글 표시
How can I add an absolute value to an optimization expression I am trying to optimize? MATLAB shows the following error :
Undefined function 'abs' for input arguments of type 'optim.problemdef.OptimizationExpression'.
problem is :
minimize abs ( ax + by + cz - d )
subject to , x,y,z are integers in some range
댓글 수: 0
답변 (2개)
Sean de Wolski
2019년 2월 1일
편집: Sean de Wolski
2019년 2월 1일
Square it instead so as to not introduce a discontinuity
(expr).^2
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Problem-Based Optimization Setup에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!