Getting symbolic equation into a format that can be used as a function for fmincon

3 ビュー (過去 30 日間)
Henry Wilkinson
Henry Wilkinson 2021 年 4 月 13 日
回答済み: Arthi Sathyamurthi 2021 年 5 月 27 日
I have some symbolic equations that need to be used as non-linear constraints in an anonymous function for fmincon.
I am having trouble getting the symbolic equations into a format that can be used by the function. This leads to the following error:
"FMINCON requires all values returned by functions to be of data type double."
Apologies for my limited knowledge in describing this problem.

回答 (1 件)

Arthi Sathyamurthi
Arthi Sathyamurthi 2021 年 5 月 27 日
From the limited information provided, I assume that you give a symbolic variable to the FMINCON function. Kindly check the class of the value obtained from the function by substituting the necessary values in your symbolic equation before passing it to the FMINCON function.
You can refer to a similar question answered on the same topic here.

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by