Unnecessary copying in Matlab Coder generated C code
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi! I generated C code with Matlab Coder can I realize that there are a lot of such unnecessary copying. What can I do to avoid that?
for (i0 = 0; i0 < 153; i0++) {
dv42[i0] = dv74[i0];
dv43[i0] = dv75[i0];
}
...
for (i0 = 0; i0 < 153; i0++) {
dv74[i0] = dv42[i0];
dv75[i0] = dv43[i0];
}
...
for (i0 = 0; i0 < 153; i0++) {
dv42[i0] = dv74[i0];
dv43[i0] = dv75[i0];
}
1 Kommentar
Ryan Livingston
am 1 Aug. 2013
Bearbeitet: Ryan Livingston
am 1 Aug. 2013
If you post a small example of MATLAB code which produces this, we may be able to give some suggestions.
Antworten (1)
Jane Jean
am 1 Aug. 2013
2 Kommentare
Walter Roberson
am 1 Aug. 2013
The copying would be appropriate if the subfunction modifies its input, which we cannot determine from what you show.
Why are you passing "a" into main_function and also assigning a value to it?
Siehe auch
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!