Saving memory by reusing a variable name?
12 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a code that uses pretty large files which causes some memory problems.
In my code I have a very large sparse matrix X, which I then multiply by a small dense matrix A. My question is, does the code:
Y=AX; clear X;
use less space when compared with:
X=AX;
1 Kommentar
Antworten (1)
Matt Tearle
am 22 Feb. 2011
I'd guess they'd be the same. Matrix multiply requires having to make an intermediate variable anyway (behind the scenes, if not explicitly).
0 Kommentare
Siehe auch
Kategorien
Mehr zu Logical 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!