C++ code generation of function handles

14 views (last 30 days)
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.

Accepted Answer

Walter Roberson
Walter Roberson on 29 Nov 2013
Anonymous functions are not supported, but handles to actual functions are.
  1 Comment
Paul Wintz
Paul Wintz on 16 Aug 2021
This answer is out of date. As of 2021a (possibly earlier), anonymous functions are supported.

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB Coder in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!