[英]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.