can I generate c/c++ code from an m file function that uses a Mupad function ?

hi , I have an m-file that uses a Mupad function looks like following :
function fibret = myfibgen(x)
fibret = feval(symengine,'numlib::fibonacci',x)
which generates nth fibonacci number using the Mupad numlib::fibonacci function,it works perfectly in the matlab comand line however when I try to generate c/c++ code from it I get following error :
"??? The function 'symengine' is not supported for standalone code generation. See the documentation for coder.extrinsic to learn how you can use this function in simulation."
question : is what I'm trying to do possible but should be done otherwise or actually not doable at all ?
thanks in advance

 Réponse acceptée

The symbolic engine cannot be compiled and cannot have code generated for it.
There are numeric routines to generate Fibonacci numbers.
Caution: F78 is the largest value that fits as an integer in an IEEE 754 double precision number. F93 is the largest that fits in a 64 bit unsigned integer.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by