Path: news.mathworks.com!not-for-mail
From: "Rodney Thomson" <readmore@iheartmatlab.blogspot.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re:
Date: Wed, 16 Jul 2008 07:42:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 31
Message-ID: <g5k8oa$al3$1@fred.mathworks.com>
References: <g5j7ua$s3u$1@fred.mathworks.com> <g5j8m9$94v$1@canopus.cc.umanitoba.ca> <g5k3v3$ruc$1@fred.mathworks.com>
Reply-To: "Rodney Thomson" <readmore@iheartmatlab.blogspot.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1216194122 10915 172.30.248.35 (16 Jul 2008 07:42:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 16 Jul 2008 07:42:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1430350
Xref: news.mathworks.com comp.soft-sys.matlab:479683



"AHMET ANIL DINDAR" <adindar@iku.edu.tr> wrote in message
<g5k3v3$ruc$1@fred.mathworks.com>...
> Thanks for the answer. I didn't know the OS was important
> for such a program since I'm not an expert on programming. 
> Anyway, I'm using XP in my comp. Is there still a chance to
> use the "batch" command?
> 
> thanks again.

One thing you could possibly do is put a try/catch block in
your mainline that encompasses all of your code. And then on
any errors you can send an email notifying the source and
reason of the error.

In the catch block you could do something like:

catch
  err = lasterror;

  error_message = sprintf('Error: %s::%s\nOccured in %s::%s
at line %d\n', err.identifier, err.message, err.stack.file,
err.stack.name, err.stack.line);

  sendmail('uhoh@itdied.com', 'Matlab process crashed',
error_message);
end

NOTE: I've not run this code so treat it as pseudocode

--
http://iheartmatlab.blogspot.com