<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: times new roman,new york,times,serif; font-size: 12pt; color: #000000'>thanks everybody for the supports<div><br></div><div>Paul<br><br><hr id="zwchr"><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>De: </b>"Mike Page" <mike.pageone@googlemail.com><br><b>À: </b>"Users mailing list for Scilab" <users@lists.scilab.org><br><b>Envoyé: </b>Jeudi 6 Octobre 2016 12:34:59<br><b>Objet: </b>Re: [Scilab-users] Scilab control after an impossible calculation<br><br><div dir="ltr"><div><div><div><div><div>Hi Paul,<br><br></div>Would Scilab's try-catch block do what you want?  For example:<br><br>for i=1:10;<br>   try;<br>      disp(1/(i-5));<br>   catch;<br>      disp("err");<br>   end;<br>end<br><br></div>won't crash when it gets to the divide by zero.<br><br></div>This is the more structured way, but you can use execstr with errcatch to do the same thing.<br><br></div>HTH<br></div>Mike.<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On 6 October 2016 at 09:51,  <span dir="ltr"><<a href="mailto:paul.carrico@free.fr" target="_blank">paul.carrico@free.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:times new roman,new york,times,serif;font-size:12pt;color:#000000"><p class="MsoNormal">Hi All<u></u><u></u></p>

<p class="MsoNormal"><u></u> <u></u></p>

<p class="MsoNormal"><span lang="EN-US">I’m using
Scilab as the interface between my optimizer and my finite element solver(s)
and sometimes Scilab stops because of unexpected and impossible calculus (1/x
with x = 0 as an example ); obviously Scilab stops (and so the optimization).<u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US"> </span></p>

<p class="MsoNormal"><span lang="EN-US">I’m
wondering if it’s possible:<u></u><u></u></span></p>

<p class="m_-2079420173628094164MsoListParagraph"><span lang="EN-US">-<span style="font-variant-numeric:normal;font-stretch:normal;font-size:7pt;line-height:normal;font-family:"Times New Roman"">         
</span></span><span lang="EN-US">To
ask back Scilab a message such as “hey I crashed because you’re a fool and
you’ve not anticipated an impossible calculation !!!”<u></u><u></u></span></p>

<p class="m_-2079420173628094164MsoListParagraph"><span lang="EN-US">-<span style="font-variant-numeric:normal;font-stretch:normal;font-size:7pt;line-height:normal;font-family:"Times New Roman"">         
</span></span><span lang="EN-US">To
get back Scilab control in order to avoid optimization process crash ? I’ve
been thinking in affecting a cost function value at %inf for example (not
elegant I recognize)<u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US"> </span></p>

<p class="MsoNormal"><span lang="EN-US">I don’t
know if I’m understandable enough …<u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US"> </span></p>

<p class="MsoNormal"><span lang="EN-US">Paul</span><u></u><u></u></p></div></div><br>_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a><br>
<a href="http://lists.scilab.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.scilab.org/mailman/listinfo/users</a><br>
<br></blockquote></div><br></div>
<br>_______________________________________________<br>users mailing list<br>users@lists.scilab.org<br>http://lists.scilab.org/mailman/listinfo/users<br></div><br></div></div></body></html>