Alternative to "besselk" and "tsearchn" functions supported by MATLAB coder for the C++ code generation

1 回表示 (過去 30 日間)
Abru
Abru 2019 年 7 月 25 日
回答済み: Hari Krishna Ravuri 2019 年 8 月 14 日
I need to transform a code from Matlab to C++ through Matlab coder and I'm looking for some alternative (if they exist) to the functions "besselk" and "tsearchn" which aren't in the list of functions supported by Matlab Coder. Or in alternative if there is any way to replace them.
Thank You!

回答 (1 件)

Hari Krishna Ravuri
Hari Krishna Ravuri 2019 年 8 月 14 日
Not all built-in functions are supported for code generation. Here, you can find the list of built-in functions for which code generation is supported. Instead, you may use the following workaround.
You may try implementing the built-in function in C/C++ or you may find a C/C++ program with the required functionality. Now you may use the external C/C++ file in your MATLAB script. For this, you may compile the external C/C++ source files into a dll/shared object and then you may load that into your MATLAB script using loadlibrary(). Please refer https://in.mathworks.com/help/matlab/ref/loadlibrary.htmlfor more information on “loadlibrary()”.
Hope this helps.

カテゴリ

Help Center および File ExchangeSpatial Search についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by