Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: problem saving matlab workspace

Subject: problem saving matlab workspace

From: Anup

Date: 13 May, 2008 04:56:03

Message: 1 of 2

I'm using matlab7.0.
The code tries to learn a particular game.
So the game is played several thousand times.
So it would take hours/days to complete the simulation.
Becuase of the regular power cuts i usually resort to
saving the work space at the end of each game using
save('filename').

Intilaly i did not face any problems with this.even though
the number of games played were as large as 10,000. But
ocassionally i had an error saying that unable to save in
the specified file. But it used to work if i either
restarted the game or changed the filename.

But now the error is now more persistent. Almost every
time the same error pops up and this usally happens around
the 1200th game or 3000th game.Can someone help me out
with this problem.

Subject: Re: problem saving matlab workspace

From: helper

Date: 13 May, 2008 05:20:19

Message: 2 of 2

"Anup " <anupekbote@gmail.com> wrote in message <g0b713
$5fp$1@fred.mathworks.com>...
> I'm using matlab7.0.
> The code tries to learn a particular game.
> So the game is played several thousand times.
> So it would take hours/days to complete the simulation.
> Becuase of the regular power cuts i usually resort to
> saving the work space at the end of each game using
> save('filename').
>
> Intilaly i did not face any problems with this.even
though
> the number of games played were as large as 10,000. But
> ocassionally i had an error saying that unable to save in
> the specified file. But it used to work if i either
> restarted the game or changed the filename.
>
> But now the error is now more persistent. Almost every
> time the same error pops up and this usally happens
around
> the 1200th game or 3000th game.Can someone help me out
> with this problem.


I'm not sure what is causing your error, however you could
try wrapping the SAVE command in a try/catch and repeating
until the save is successful.

errorOccurred = true;
while errorOccurred
  try
    errorOccurred = false;
    save(...)
  catch
    errorOccurred = true;
    % Maybe put a pause or drawnow
    % or even changing the filename here
  end
end

Also, within the CATCH, you might want to verify (using the
LASTERROR command) that the error that occurred is actually
the one you want to ignore.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
save workspace Anup 13 May, 2008 01:00:26
rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics