Unnecessary copying of variables in generated code

조회 수: 8 (최근 30일)
Y
Y 2012년 8월 20일
Hi, I am trying to call a function that has an argument both as input and output (for example: varA=foo(varA)). In the generated C-code, the variable varA is first copied to some temporary variable, then varA (the original, not the temporary) is passed (as a pointer) to the function and in the end the temporary variable is copied back to varA.
Is there any way to prevent this from happening?
Thank you.
  댓글 수: 2
Arnab De
Arnab De 2012년 9월 6일
Can you please tell us which version of MATLAB you are using?
Mike Hosea
Mike Hosea 2012년 9월 6일
Another question: Is the function defined in the a = foo(a) form, or is that just what the call site looks like?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Coder에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by