C++ code generation of function handles

조회 수: 5 (최근 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 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