Matlab crashing due to covariance command
Mostra commenti meno recenti
I am attempting to compute the covariance matrix of a 200x644 matrix as part of PCA analysis. I know the code works as it runs on the main computers within the university but the cov() command appears to keep crashing my laptop.
I'm assuming this is a result of my laptop's performance not being as good as the main PC, but I'm not sure what part (e.g. lack of RAM) is likely to be the issue.
Can anyone suggest a possible cause?
3 Commenti
Andreas Goser
il 3 Feb 2015
Can you share the crash dump?
Carl
il 3 Feb 2015
Carl
il 3 Feb 2015
Risposte (2)
John D'Errico
il 3 Feb 2015
Modificato: John D'Errico
il 3 Feb 2015
I think it is more important that we are told...
What version of MATLAB are you running? What does this tell you:
ver
Are you merely trying to execute cov(X), where x is a 200x644 matrix? Or are you doing something slightly different that would cause cov to try to create a matrix of size (128800x128800)? Note that 128800=200*644.
Do you have something called cov defined? What does MATLAB tell you when you type
which cov -all
The answers to these questions would lead me to conclude various possibilities as the answer.
1. You have insufficient RAM. Older MATLAB releases that do not work in 64 bits will fail here often. This is not a big problem, but for a machine with little RAM and an old release that cannot use virtual memory, hey, there are limits. And if you have defined other moderately large variables, then it just runs out of room.
2. You have some other function called cov which you have created. Since you may have done anything here, I cannot say how it might be causing a problem. But overloading existing MATLAB functions will surely cause problems, and MANY people do this accidentally, at least at first.
3. Your system is having "issues", probably in the form of a corrupted disk.
4. MATLAB was improperly installed, in some unknown and random way.
So it is likely one of the above possibilities. I've listed them in decreasing order of probability, from my point of view.
3 Commenti
Carl
il 3 Feb 2015
John D'Errico
il 3 Feb 2015
Modificato: John D'Errico
il 3 Feb 2015
Ok, so a non-64 bit release is out of the question. And I'm feeling mentally lazy right now, so I let MATLAB do this next step for me. :)
A = cov(rand(200,644));
whos A
Name Size Bytes Class Attributes
A 644x644 3317888 double
So the covariance matrix would take up only 3 megabytes, a tiny thing really.
If MATLAB is actually crashing, as opposed to running a long time and heavily swapping to disk... Well actually the latter case is not an issue, since again, this matrix is literally tiny by today's standards. And you did say crash after all.
So while more RAM is never a bad thing, I doubt it is an issue. You might try a pack command, or checking the available memory, but I think that is simply not the issue here.
I don't know enough about Windoze to know where the crash dump will live. But I expect the file name will be something roughly like
matlab_crash_dump.259-1
At least that is how it appears on my Mac.
Carl
il 3 Feb 2015
Andreas Goser
il 5 Feb 2015
0 voti
Categorie
Scopri di più su Gaussian Process Regression 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!