Missing variables from save function

조회 수: 6 (최근 30일)
EmilyWD
EmilyWD 2012년 10월 10일
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?

채택된 답변

Walter Roberson
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()
  댓글 수: 1
EmilyWD
EmilyWD 2012년 10월 10일
It's possible. I will try that and see if it works. Thanks!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Whos에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by