Missing variables from save function
6 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Walter Roberson
2012-10-10
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()
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Whos 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!