简体   繁体   English

Matlab上的C ++编码器,sym和perms函数?

[英]Coder on Matlab to C++ , sym and perms function?

I am discovering the coder tool in Matlab. 我在Matlab中发现了编码器工具。 some of my code was successfully converted but it fails in functions which contain the functions "sym" for symbolic and "perms" for permutations. 我的某些代码已成功转换,但是在包含符号“ sym”和排列“ perms”的函数中失败。 Also I seem to get an error when I save the answer "ans" of for example "A==B". 当我保存例如“ A == B”的答案“ ans”时,我似乎也出错了。 Any idea how to solve this problem? 任何想法如何解决这个问题?

Thank you for your help 谢谢您的帮助

Here is an example of parts of my matlab function that cannot be transformed into c++ with coder: 这是我的matlab函数无法通过编码器转换为c ++的部分示例:

b=4;
s=2;
one=ones(factorial(b),1);
two=2*ones(factorial(b),1);
B=perms(s+1:b+s);

S=[one,two,B];
sz=size(S);

%%%%%%%%%%%%%%%%%%%

L=[1,3;1,4;1,5;1,6;2,3;2,4;2,5;2,6];
x=perms(1:8);
M=[];

Some toolbox functions cannot be compiled, ie they can only be run from a MATLAB session. 有些工具箱功能无法编译,即只能从MATLAB会话中运行。 The following post tells us that functionality in the Symbolic toolbox cannot be compiled. 下面的帖子告诉我们,符号工具箱中的功能无法编译。

http://se.mathworks.com/matlabcentral/answers/96441-why-am-i-unable-to-compile-functions-from-the-symbolic-math-toolbox http://se.mathworks.com/matlabcentral/answers/96441-why-am-i-unable-to-compile-functions-from-the-symbolic-math-toolbox

So most likely this is the reason why you are running into problems when you try to run it in compiled form. 因此,最有可能的原因就是您尝试以编译形式运行它时遇到问题的原因。

More info about compiler support for various toolboxes can be found here: 有关各种工具箱的编译器支持的更多信息,请参见:

http://se.mathworks.com/products/compiler/supported/compiler_support.html http://se.mathworks.com/products/compiler/supported/compiler_support.html

Symbolic Math toolbox does not appear on the list and any toolbox that is not listed is not supported (ie cannot be compiled). 符号数学工具箱未出现在列表中,并且不支持未列出的任何工具箱(即,无法编译)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 导入功能Matlab Coder和C ++可执行文件 - import function Matlab Coder and C++ executable MATLAB 到 C++:MATLAB Coder 不支持 csvread() - MATLAB to C++: csvread() not supported by MATLAB Coder 使用MATLAB编码器将MATLAB转换为C ++ - Convert MATLAB to C++ using MATLAB coder 使用Matlab Coder将matlab代码和c / c ++代码结合起来用于mex函数 - Combining matlab code and c/c++ code for mex function using Matlab Coder 我们可以使用 matlab 编码器将 function 中内置的 matlab 转换为 c/c++ 代码吗 - Can we convert a matlab built in function to c/c++ code using matlab coder 在Matlab中以非递归方式实现烫发,与Coder兼容 - Non-recursive implementation of perms in Matlab, compatible with Coder 具有外部C ++函数的Matlab:coder.ceval将结构传递给函数 - Matlab with external C++ function: coder.ceval pass a structure to a function 使用 Matlab 编码器将 Matlab 代码转换为 C++ - 单元问题 - Converting Matlab code to C++ with Matlab Coder - Cell problem 通过Coder将Matlab音频读取/音频播放转换为C / C ++ - Matlab audioread/audioplay into C/C++ through Coder 如何将MATLAB图像处理库的内置函数转换为Matlab编码器代码生成不支持的c ++? - How can I convert MATLAB image processing library build-in function to c++ that is not supported by matlab coder code generation?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM