Does Matlab coder self checking Matlab output vs. C code output when generating code?
2 ビュー (過去 30 日間)
古いコメントを表示
Yufei Zhang
2021 年 4 月 21 日
回答済み: Darshan Ramakant Bhat
2021 年 4 月 21 日
When using Matlab coder for C code generation, sometimes we might not get 100% line execution from the entry point test code. i.e. ( picture taken from https://www.mathworks.com/help/coder/ug/collect-and-view-line-execution-counts-for-your-matlab-code.html )
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/591235/image.png)
There is one question regarding to generated code with Matlab Coder, if the line execution count does not hit 100%, is it a must to modify test code to achieve 100% execution?
And during generation is it the coder doing self checking Matlab output vs. the C code output automatically? Or is it just replacing the function call with C code and see if output matches?
0 件のコメント
採用された回答
Darshan Ramakant Bhat
2021 年 4 月 21 日
Line execution count just gives you the code coverage data from the test. It is not necessary to achieve 100% execution in order for you to get a C/C++ code.
Coder will not automatically check if the outputs are equal in MATLAB and C, but you can do it using below approach :
Hope this will help you.
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!