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 Center および File ExchangeWhos についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by