Code generation for "quadprog"
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
Hi, I am trying to get code generation for "quadprog", I am getting error message "Function 'optimoptions' not supported for code generation". I am using MATLAB2018b. What might be the possible solutions?
採用された回答
Ameer Hamza
2020 年 11 月 11 日
Code generation for optimoptions is only enabled in R2020b, and for quadprog(), it was enabled in R2020a. There is no way to get it in R2018b.
13 件のコメント
KEERTHI CHACKO
2020 年 11 月 11 日
Thank you
Ameer Hamza
2020 年 11 月 11 日
I am glad to be of help!
li gu
2021 年 3 月 8 日
I want to ask why I upgrade matlab to 2020, but still report an error to show that this function cannot generate code?
Steven Lord
2021 年 3 月 8 日
Did you upgrade to release R2020a or release R2020b?
li gu
2021 年 3 月 8 日
Upgrade 2020b, and I read the quadprog document. It's different from the previous version. It does have an extension function, which is to generate C code, but there are several restrictions. Then I modify the code one by one according to the conditions, basically meeting the requirements. I do hardware in the loop simulation, and need to compile to generate code. However, because this function compiles, it will still report an error. The error is as follows
“The extrinsic function 'quadprog' is not available for standalone code generation. It must be eliminated for stand-alone code to be generated. It could not be eliminated because its outputs appear to influence the calling function. Fix this error by not using 'quadprog' or by ensuring that its outputs are unused.”
Alan Weiss
2021 年 3 月 9 日
Can you run the example Generate Code for quadprog? If not, then I suggest that you contact technical support. If so, then the fault is somewhere else in your code, because quadprog is supported.
Alan Weiss
MATLAB mathematical toolbox documentation
li gu
2021 年 3 月 10 日
Later I ran this example and found the problem. Matlab did not find a supported compiler. Then I downloaded the MinGW-w64 C/C++ compiler. I ran this example successfully, but my hardware device supports VS software. , I downloaded VS2015 on my computer before, but why the VS compiler cannot be displayed when MATLAB runs the mex -setup command? I reinstalled VS2017 and MATLAB2020, but still can’t find the compiler. How can I solve this problem ?
li gu
2021 年 3 月 10 日
Now matlab (2020b) has found a supported compiler (vs2017), but I still report an error in the process of compiling the model (The extrinsic function 'quadprog' is not available for standalone code generation). Previously, I used MinGW compiler to try to generate code for quadprog test cases, but the hardware in the loop simulation I did only supports vs compiler, so how can I solve this problem?
li gu
2021 年 3 月 10 日

li gu
2021 年 3 月 10 日

li gu
2021 年 3 月 10 日
The above two figures are the established Simulink model and the self-defined AdaptiveMPC function in the model. There is a quadratic programming solving function quadprog in the function. The error is that this function cannot generate code.
li gu
2021 年 3 月 10 日
Just now, it is OK to generate the test example of Quadlog function with vs2017 compiler. However, compiling my model will report the error that the Quadlog function cannot generate code.
GE YINBO
2021 年 9 月 30 日
Dear li, has your hardware in the loop simulation with quadprog been implemented.
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Get Started with MATLAB Coder についてさらに検索
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
