Use optimization variable in a function in a constraint

1 回表示 (過去 30 日間)
Joel Baltes
Joel Baltes 2022 年 5 月 10 日
コメント済み: Matt J 2023 年 10 月 12 日
Hello :)
While trying to work around the problem-based solver for an optimization problem Im working on, I encountered the error "Unable to perform assignment because value of type 'optim.problemdef.OptimizationExpression' is not convertible to 'double'." I am trying to use an external self-written function, which uses two of my optimization variables as variables, and we need the output of the external function for the constraint value.
  1 件のコメント
Matt J
Matt J 2023 年 10 月 12 日
We need to see the code.

サインインしてコメントする。

回答 (1 件)

Rohit Kulkarni
Rohit Kulkarni 2023 年 10 月 12 日
Hi Joel,
I understand you are getting the error "Unable to perform assignment because value of type 'optim.problemdef.OptimizationExpression' is not convertible to 'double'." while working on an optimisation problem.
Often, this error comes from an improper initialization of an optimization expression.
Please refer to the documentation provided below for the detailed explanation and examples for resolving this error:
Hope it helps!

カテゴリ

Help Center および File ExchangeGet Started with Optimization Toolbox についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by