out of memory, how to solve?
Mostra commenti meno recenti
i was running a script and in the middle the program get me out of memory error. how can i solve it? the problem is probably the dimension of the workspace that is more than 2 GB at the time of the error.
thanks
6 Commenti
M
il 5 Dic 2017
What is your script ?
matteo avanzi
il 5 Dic 2017
Modificato: matteo avanzi
il 5 Dic 2017
matteo avanzi
il 5 Dic 2017
Modificato: matteo avanzi
il 5 Dic 2017
Walter Roberson
il 5 Dic 2017
Are you using R2016b or later? If you are, then check to see if you are accidentally using a mix of row vectors and column vectors: R2016b and later treats that as if you had used bsxfun() instead of giving an error.
matteo avanzi
il 5 Dic 2017
matteo avanzi
il 5 Dic 2017
Risposte (1)
Rik
il 5 Dic 2017
As Walter hinted, the problem is implicit expansion:
A=1:4;
B=A';
A.*B
ans =
1 2 3 4
2 4 6 8
3 6 9 12
4 8 12 16
So your syntax expands the already large vectors to an even larger matrix. Adding a transpose to one of the vectors will solve this.
Categorie
Scopri di più su Gravitation, Cosmology & Astrophysics in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!