Missing variables from save function
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am trying to save a matlab project file for future use after loading some data. I need to save six variables, but the project is only saved with three of the six I specified. I also tried saving the whole project, and it ended up deleting the two most important variables of the project! Here is the relevant code:
atmyr = 1993;
diam = 50;
.
.
.
around = floor(A(:,1:2)./diam).*diam;
lround = floor(AL(:,1:2)./diam).*diam;
unq = intersect(around, lround, 'rows');
sfile = sprintf('LoadQ_%im_%i_q2.mat',diam,atmyr);
save(sfile,'AL','A','lround','around','unq','diam');
save('matlabtest.mat');
The code runs fine and no errors are generated. The first save function only saved the unq, diam, and around variables. The second save function appears to save all variables except, again, 'A', 'AL', and 'lround'. 'A' and 'AL' are very large non-sparse matrices (hundreds of millions of rows by 7 columns). 'around' and 'lround' have the same number of rows as 'A' and 'AL' with just 2 columns. 'unq' is ~140,000 by 2. 'Diam' is a number. I will try switching the last two save commands and see if that does anything helpful. Otherwise, I have no idea what the problem could be. Does anyone have any ideas?
0 commentaires
Réponse acceptée
Walter Roberson
le 10 Oct 2012
The arrays that are lost: are they more than 2 Gb ? If so then you need to use the -v7.3 option when you save()
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Whos dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!