Hi all,<div><br></div><div>I am currently working on a huge optimization (impossible to have it done on pure scilab), so my cost function is an external fortran function. I've tried a few small examples and everything is working fine (links, results, etc).</div>

<div><br></div><div>The external subroutine should be on the form:</div><div><br></div><div><pre class="scilabcode" style="margin-bottom:0px;margin-top:0px;overflow-x:auto;width:872px;word-wrap:break-word;color:rgb(51,51,51);font-size:13px;line-height:15px">

<span class="scilabid" style="color:rgb(0,0,0)">subroutine</span> <span class="scilabid" style="color:rgb(0,0,0)">costf</span><span class="scilabopenclose" style="color:rgb(74,85,219)">(</span><span class="scilabid" style="color:rgb(0,0,0)">ind</span><span class="scilabdefault" style="color:rgb(0,0,0)">,</span><span class="scilabid" style="color:rgb(0,0,0)">n</span><span class="scilabdefault" style="color:rgb(0,0,0)">,</span><span class="scilabid" style="color:rgb(0,0,0)">x</span><span class="scilabdefault" style="color:rgb(0,0,0)">,</span><span class="scilabid" style="color:rgb(0,0,0)">f</span><span class="scilabdefault" style="color:rgb(0,0,0)">,</span><span class="scilabid" style="color:rgb(0,0,0)">g</span><span class="scilabdefault" style="color:rgb(0,0,0)">,</span><span class="scilabid" style="color:rgb(0,0,0)">ti</span><span class="scilabdefault" style="color:rgb(0,0,0)">,</span><span class="scilabid" style="color:rgb(0,0,0)">tr</span><span class="scilabdefault" style="color:rgb(0,0,0)">,</span><span class="scilabid" style="color:rgb(0,0,0)">td</span><span class="scilabopenclose" style="color:rgb(74,85,219)">)</span></pre>

</div><div><br></div><div>Then, I can call it via scilab, passing integer, real, or double arguments (ti, tr, td, respectively). Unfortunately, I couldn't find a way to pass text strings (if needed) and also matrices. I have a cost function which should count on a huge matrix (for example, dimension 10.000,3). Is there a way to pass it via optim?</div>

<div><br></div><div>Best regards,<br>-- <br>
</div><div>Eduardo Torrecillas</div>