Absolute Value in optimization expression
32 ビュー (過去 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!