C++ code generation of function handles

5 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 MATLAB Coder 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by