Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

restarting a matlab app automatically if it fails

Status
Not open for further replies.

bonosa

Computer
Jun 1, 2006
10
My matlab app processes a bunch of files and if it hits a bad file it fails and stops. I would like it to restart itself after it comments out the offending file. so I would like to know how I can get notified that the app has failed (stopped).
thanks,
sb
 
Replies continue below

Recommended for you

Bonosa,

Is the bad file bad because it is corrupted or because it doesnt meet certian criteria in the process scheme?

You could run an initial check/process that would decide whether a file was bad or not. With that info you can then jump back to before the process loop and remove it from the file list that is being passed to the process loop and start all over again...


How to get around it really depends on why it is being tagged as bad.

But my feeling is that the app stops because you are arriving at an end before something that would edit the file list and begin the process again.

Hope this helps some... else supply more info :)

BSK
 
I'm working on a try catch, and when it errors (in the catch block) it reads the m file (with the list of files in it) upto the 'bad' file...discards all these, then writes another m file with the remaining unprocessed file and launches this new file.Thats my idea...

BTW when you do an eval('fcn') you can also do eval('fcn','backupfcn') where backupfcn runs if fcn errors out.
Had some troubles changing directories, so will do the try catch instead and see.
thanks for taking the time to respond,
sb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor