arguments in embedded coder
2 ビュー (過去 30 日間)
古いコメントを表示
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!
0 件のコメント
採用された回答
Walter Roberson
2012 年 12 月 10 日
Yes, it is fine to have the same variable name on input and output.
Yes it is fine to use the same variable name in different functions.
その他の回答 (1 件)
Ryan Livingston
2012 年 12 月 17 日
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:
0 件のコメント
参考
カテゴリ
Help Center および 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!