Unnecessary copying of variables in generated code

8 Ansichten (letzte 30 Tage)
Y
Y am 20 Aug. 2012
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 Kommentare
Arnab De
Arnab De am 6 Sep. 2012
Can you please tell us which version of MATLAB you are using?
Mike Hosea
Mike Hosea am 6 Sep. 2012
Another question: Is the function defined in the a = foo(a) form, or is that just what the call site looks like?

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu MATLAB Coder finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by