arguments in embedded coder
显示 更早的评论
Hi, I just want to know, If is correct the next function.
function [p,L] = exchange2 (p,D)
I mean, to have the same name to input variable and output variable.
another doubt is if Can I use the same variable name, but in different functions in the same file. I explain well.
regards!
采纳的回答
更多回答(1 个)
Ryan Livingston
2012-12-17
1 个投票
Moreover, using the same variable as an input and output may trigger an optimization which reduces copies in the generated code. Namely, the input "p" may be passed by reference in this case:
类别
在 帮助中心 和 File Exchange 中查找有关 Deployment, Integration, and Supported Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!