Code conversion using matlab coder
23 ビュー (過去 30 日間)
古いコメントを表示
Please help if anyone has gone through this.
1) I need to convert a matlab code which makes calls to 6 functions. The functions are written in separate scripts. The main file does the function call to these routines. The code is perfrctly working in Matlab. I donot know how to convert this main file from Matlab to C using Matlab coder. My doubt here is, should I convert each routine separately and then write a main C routine on my own to call these functions ? Or is there a method to directly convert the matlab file which calls these functions? I have to define a structure in the main code as well, and entering all the elements of struct externally everytime is becoming tedious. When I try to convert the main file of matlab directly it says enter a code that exercises the script, I really didnot get what it is. I also would like to know how to write a test script. Is there any specific rules or guidelines fror this ?
0 件のコメント
採用された回答
Sean de Wolski
2021 年 9 月 9 日
Being pedantic, you should NOT be using scripts but functions for everything. So step 1 is convert everything to functions.
Re:
Or is there a method to directly convert the matlab file which calls these functions
You can do this, simply pick it as the entry point function in MATLAB Coder app and the dependencies will come along (you can choose to keep them separate or inline in settings). If you want the other functions to be valid entry points then you could add them too, but that does not seem to be the case.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!