C++ code generation of function handles

5 visualizaciones (últimos 30 días)
Zeno
Zeno el 28 de Nov. de 2013
Comentada: Paul Wintz el 16 de Ag. de 2021
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.

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre MATLAB Coder en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by