Info
この質問は閉じられています。 編集または回答するには再度開いてください。
Convert Mathlab to c/c++ convert issue
1 回表示 (過去 30 日間)
古いコメントを表示
I have installed matlab version 2012b(full installation) and Microsoft Windows SDK 7.1 in my PC. I have set compiler using this "mbuild" command (set successfully). After I try to convert very simple matlab code to c/c++ code. But I am getting following error like screenshot
Any one can please help me? Thanks in advance
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/160463/image.png)
0 件のコメント
回答 (2 件)
Piet
2014 年 4 月 8 日
編集済み: Piet
2014 年 4 月 8 日
I think it is because a and b are undefined. Usually you call it like for example sum_of_two_numbers(4,7). Just like the C code:
int sum;
int ss2n(int a, int b)
{
sum = a + b;
return sum;
}
When you call the function you supply the values of a and b, compute the result and put it in sum and return that.
0 件のコメント
Ryan Livingston
2014 年 4 月 8 日
編集済み: Ryan Livingston
2014 年 4 月 8 日
Can you try:
mex -setup
rather than mbuild? The command mbuild is for MATLAB Compiler rather than MATLAB Coder.
0 件のコメント
この質問は閉じられています。
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!