C++ code generation of function handles

3 ビュー (過去 30 日間)
Zeno
Zeno 2013 年 11 月 28 日
コメント済み: Paul Wintz 2021 年 8 月 16 日
I would like to convert my matlab code to C++ code
F = @(x,u) cp_dyn_mex(x,u);
Fp = @(x,u) pour(F,x,u);
DYN = @(x,u,t) diff_xu(Fp, x, u, herr, order);
I get the following:
Caused by:     Error determining type for input 'pour:fun'.         Class function_handle is not supported by coder.Type.

採用された回答

Walter Roberson
Walter Roberson 2013 年 11 月 29 日
Anonymous functions are not supported, but handles to actual functions are.
  1 件のコメント
Paul Wintz
Paul Wintz 2021 年 8 月 16 日
This answer is out of date. As of 2021a (possibly earlier), anonymous functions are supported.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Coder についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by