Passing data by reference to Matlab toolbox functions for code generation
7 ビュー (過去 30 日間)
古いコメントを表示
Hello everyone.
I am working on optimization of generated code. My algorithm uses toolbox function interp1 for linear interpolation. Code for it is generated by Matlab embedded coder. I want to prevent copying of input arrays to it. Normally function doesn't define input argument as in/out, but algorithm doesn't use them afterwards and copy is redundant. Is there a way to tell Matlab coder about it to do optimization.
0 件のコメント
回答 (1 件)
Harsh
2025 年 1 月 30 日 11:36
Hi Jakub,
You can use the same variable as both an input and an output. This avoids the parameter being passed by value in the generated code. For more information regarding this practice please check the following documentation - https://www.mathworks.com/help/coder/ug/eliminate-redundant-copies-of-function-inputs.html
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!