<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Bonjour,<br>
<div class="moz-forward-container"> <br>
Retraité, je cherche à transférer mes programmes Linux (développé
avec Scilab depuis plus de 10 ans) <br>
sous Windows 10. <br>
<br>
Je veux lire un fichier binaire écrit par un programme FORTRAN
avec ces quelques lignes :<br>
<br>
<pre style="font-family:Monospaced;font-style:normal;font-size:12.0;"><span style="color:rgb(74,85,219);">[</span><span style="color:rgb(0,0,0);">u</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(0,0,0);">ierr</span><span style="color:rgb(74,85,219);">]</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(50,185,185);">mopen</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">filename</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(188,143,143);">rb</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">;</span><span style="color:rgb(0,0,0);">
ml4</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(50,185,185);">mgeti</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">4</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(188,143,143);">il</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(0,0,0);">u</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">;</span>
<span style="color:rgb(50,185,185);">printf</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(188,143,143);"> ML4 = %d %d \n</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(0,0,0);">ml4</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">1</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(0,0,0);">ml4</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">2</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">;</span>
<span style="color:rgb(0,0,0);">npts</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(50,185,185);">iconvert</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(50,185,185);">int</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">ml4</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">2</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(92,92,92);">/</span><span style="color:rgb(188,143,143);">2</span><span style="color:rgb(92,92,92);">+</span><span style="color:rgb(188,143,143);">0.01</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(188,143,143);">12</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">;</span>
<span style="color:rgb(0,0,0);">ii</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(0,0,0);">npts</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">1</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">;</span>
<span style="color:rgb(0,0,0);">xbuf</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(50,185,185);">mget</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">ii</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(188,143,143);">fl</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(0,0,0);">u</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">;
si ii a bien la valeur demandée et le bon type :
-->ii =
292
-->isscalar(ii)
ans =
T
-->inttype(ii)
ans =
12.
j'ai une erreur :
xbuf=mget(ii,'fl',u);
!--error 999
mget : Type erroné de l'argument d'entrée n°1 : Une valeur entière positive attendue.
at line 58 of exec file called by :
exec('C:\cygwin64\home\yves\WAVEPRO\ytrace.sci', -1)
alors que l'ordre :
</span>
<span style="color:rgb(0,0,0);"><span style="color:rgb(0,0,0);"> xbuf=mget(292,'fl',u);
donne bien les valeurs attendues !!!
-->xbuf(1:10)
ans =
column 1 to 5
0.0013759 0.1500000 0.0013759 0.249984 0.0013759
column 6 to 10
0.3499920 0.0013759 0.4500000 0.0013759 0.5499840
</span> Toute suggestion est bienvenue.
Cordialement,
</span></pre>
<pre style="font-family:Monospaced;font-style:normal;font-size:12.0;"><span style="color:rgb(0,0,0);"></span><span style="color:rgb(0,0,0);"></span><span style="color:rgb(0,0,0);"></span><span style="color:rgb(74,85,219);"></span><span style="color:rgb(92,92,92);"></span><span style="color:rgb(50,185,185);"></span><span style="color:rgb(74,85,219);"></span><span style="color:rgb(0,0,0);"></span><span style="color:rgb(0,0,0);"></span><span style="color:rgb(188,143,143);"></span><span style="color:rgb(188,143,143);"></span><span style="color:rgb(188,143,143);"></span><span style="color:rgb(74,85,219);"></span><span style="color:rgb(0,0,0);"></span></pre>
<br>
<br>
<hr style="border:none; color:#909090; background-color:#B0B0B0;
height: 1px; width: 99%;">
<table style="border-collapse:collapse;border:none;">
<tbody>
<tr>
<td style="border:none;padding:0px 15px 0px 8px"> <a
moz-do-not-send="true"
href="https://www.avast.com/antivirus"> <img
moz-do-not-send="true"
src="http://static.avast.com/emails/avast-mail-stamp.png"
alt="Avast logo" border="0"> </a> </td>
<td>
<p style="color:#3d4d5a;
font-family:"Calibri","Verdana","Arial","Helvetica";
font-size:12pt;"> L'absence de virus dans ce courrier
électronique a été vérifiée par le logiciel antivirus
Avast. <br>
<a moz-do-not-send="true"
href="https://www.avast.com/antivirus">www.avast.com</a>
</p>
</td>
</tr>
</tbody>
</table>
<br>
<br>
</div>
<br>
<br /><br />
<hr style='border:none; color:#909090; background-color:#B0B0B0; height: 1px; width: 99%;' />
<table style='border-collapse:collapse;border:none;'>
<tr>
<td style='border:none;padding:0px 15px 0px 8px'>
<a href="https://www.avast.com/antivirus">
<img border=0 src="http://static.avast.com/emails/avast-mail-stamp.png" alt="Avast logo" />
</a>
</td>
<td>
<p style='color:#3d4d5a; font-family:"Calibri","Verdana","Arial","Helvetica"; font-size:12pt;'>
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
<br><a href="https://www.avast.com/antivirus">www.avast.com</a>
</p>
</td>
</tr>
</table>
<br />
</body>
</html>