<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style><!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="Section1">
<p class="MsoNormal">Hi all,<o:p></o:p></p>
<p class="MsoNormal">I have tried the GUI for the bulk conversion of matlab to scilab in a single folder but it does not work. Instead, I tried the following script below but this crashes Scilab! Does anyone have a solution for either problem? I am using Scilab
 5.4.0.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">// read each .m file and run matfile2sci    <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">host('S:')<o:p></o:p></p>
<p class="MsoNormal">cd ("S:\somepath\matlab")<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">if getos() == 'Windows' then<o:p></o:p></p>
<p class="MsoNormal">    filelist=unix_g('dir /B *.m')<o:p></o:p></p>
<p class="MsoNormal">else<o:p></o:p></p>
<p class="MsoNormal">    filelist=unix_g('ls *.m')<o:p></o:p></p>
<p class="MsoNormal">end<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">n=size(filelist,1);<o:p></o:p></p>
<p class="MsoNormal">for i = 1:n,<o:p></o:p></p>
<p class="MsoNormal">    outputfile = filelist(i);<o:p></o:p></p>
<p class="MsoNormal">    m = length(outputfile);<o:p></o:p></p>
<p class="MsoNormal">    outputfile = part(outputfile,1:(m-1))+".conv";<o:p></o:p></p>
<p class="MsoNormal">    matfile2sci(filelist(i),outputfile), end;<o:p></o:p></p>
<p class="MsoNormal">end;<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal">Richard<o:p></o:p></p>
</div>

<P>---</P>
<P>Fugro Robertson Limited<BR>Tyn y Coed<BR>Llanrhos<BR>Llandudno<BR>North 
Wales<BR>LL30 1SA<BR>United Kingdom</P>
<P>Tel: +44 (0)1492 581811<BR>Fax: +44 (0)1492 583416</P>
<P>General Email: <A 
href="mailto:info@fugro-robertson.com">info@fugro-robertson.com</A></P>
<P>Website: <A 
href="http://www.fugro-robertson.com">www.fugro-robertson.com</A></P>
<P>This email communication (including any attachments) may <BR>contain 
confidential and privileged information intended solely <BR>for the individual 
to whom it is addressed.  If you are not the <BR>intended recipient, you 
are hereby notified that any <BR>dissemination, disclosure, distribution or 
copying is strictly <BR>prohibited and any reliance on this email (including any 
<BR>attachments), or on any information contained in it or use of <BR>any 
information contained in it, is strictly prohibited and may <BR>be unlawful.</P>
<P>The sender of this email communication is not an officer of the <BR>Company 
and therefore has no authority whatsoever to bind the <BR>company legally to any 
contractual arrangements.</P>
<P>If you have received this communication in error, please notify <BR>the 
sender by telephone and delete the communication.</P>
<P>Fugro Robertson Limited is a limited company registered in <BR>England and 
Wales (Reg No. 3006207) at Tyn y Coed, Pentwyn Road, Llanrhos, Conwy, LL30 
1SA.  VAT No. GB682004360.</P>
</body>
</html>