<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" 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"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1649" name=GENERATOR>
<STYLE>@font-face {
        font-family: Calibri;
}
@font-face {
        font-family: Tahoma;
}
@page WordSection1 {size: 612.0pt 792.0pt; margin: 70.85pt 70.85pt 70.85pt 70.85pt; }
P.MsoNormal {
        FONT-SIZE: 11pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Calibri","sans-serif"; mso-fareast-language: EN-US
}
LI.MsoNormal {
        FONT-SIZE: 11pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Calibri","sans-serif"; mso-fareast-language: EN-US
}
DIV.MsoNormal {
        FONT-SIZE: 11pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Calibri","sans-serif"; mso-fareast-language: EN-US
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
P.MsoAcetate {
        FONT-SIZE: 8pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Tahoma","sans-serif"; mso-fareast-language: EN-US; mso-style-priority: 99; mso-style-link: "Texte de bulles Car"
}
LI.MsoAcetate {
        FONT-SIZE: 8pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Tahoma","sans-serif"; mso-fareast-language: EN-US; mso-style-priority: 99; mso-style-link: "Texte de bulles Car"
}
DIV.MsoAcetate {
        FONT-SIZE: 8pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Tahoma","sans-serif"; mso-fareast-language: EN-US; mso-style-priority: 99; mso-style-link: "Texte de bulles Car"
}
SPAN.EmailStyle17 {
        COLOR: windowtext; FONT-FAMILY: "Calibri","sans-serif"; mso-style-type: personal-compose
}
SPAN.TextedebullesCar {
        FONT-FAMILY: "Tahoma","sans-serif"; mso-style-priority: 99; mso-style-link: "Texte de bulles"; mso-style-name: "Texte de bulles Car"
}
.MsoChpDefault {
        FONT-FAMILY: "Calibri","sans-serif"; mso-fareast-language: EN-US; mso-style-type: export-only
}
DIV.WordSection1 {
        page: WordSection1
}
</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=FR vLink=purple link=blue>
<DIV><SPAN class=359324809-08022011><FONT face=Arial color=#0000ff size=2>Hi 
Loic,</FONT></SPAN></DIV>
<DIV><SPAN class=359324809-08022011><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=359324809-08022011><FONT face=Arial color=#0000ff size=2>Not 
sure what you want exactly, but the file looks like a set of floats (4-byte IEEE 
754 floating point values).  You can read these using:</FONT></SPAN></DIV>
<DIV><SPAN class=359324809-08022011><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=359324809-08022011><FONT face=Arial color=#0000ff size=2>a = 
mget (n, 'f', fd)</FONT></SPAN></DIV>
<DIV><SPAN class=359324809-08022011><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=359324809-08022011><FONT face=Arial color=#0000ff size=2>where 
n is the number you want to read and fd is the file descriptor (you get that 
using fd=mopen("F1_31.dat",'rb').</FONT></SPAN></DIV>
<DIV><SPAN class=359324809-08022011><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=359324809-08022011><FONT face=Arial color=#0000ff size=2>If you 
really want the values in hex, then it depends on how many bytes per hex 
value.  If there are 4 bytes each, then you can use something 
like:</FONT></SPAN></DIV>
<DIV><SPAN class=359324809-08022011><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=359324809-08022011><FONT face=Arial color=#0000ff size=2>a = 
dec2hex (mget (n, 'l', fd))</FONT></SPAN></DIV>
<DIV><SPAN class=359324809-08022011><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=359324809-08022011><FONT face=Arial color=#0000ff size=2>Hope 
that helps.</FONT></SPAN></DIV>
<DIV><SPAN class=359324809-08022011><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=359324809-08022011><FONT face=Arial color=#0000ff 
size=2>Mike.</FONT></SPAN></DIV>
<DIV><SPAN class=359324809-08022011></SPAN> </DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma 
  size=2>-----Original Message-----<BR><B>From:</B> Loïc GIROD 
  [mailto:Loic.Girod@esstin.uhp-nancy.fr]<BR><B>Sent:</B> 08 February 2011 
  09:13<BR><B>To:</B> users@lists.scilab.org<BR><B>Subject:</B> [scilab-Users] 
  reading file in hexadecimal<BR><BR></FONT></DIV>
  <DIV class=WordSection1>
  <P class=MsoNormal><SPAN lang=EN-US>Hello, <o:p></o:p></SPAN></P>
  <P class=MsoNormal><SPAN lang=EN-US><o:p> </o:p></SPAN></P>
  <P class=MsoNormal><SPAN lang=EN-US>Beginner under scilab, I’m trying to make 
  a script to read a file and make some calculations on the 
  data.<o:p></o:p></SPAN></P>
  <P class=MsoNormal><SPAN lang=EN-US>I would like to read the file attached 
  (F1_31) as an hexa format.<o:p></o:p></SPAN></P>
  <P class=MsoNormal><SPAN lang=EN-US>For the moment, I use notepad++ to convert 
  the file in hexadecimal and I can read it in scilab using 
  mopen/mfscanf.<o:p></o:p></SPAN></P>
  <P class=MsoNormal><SPAN lang=EN-US><o:p> </o:p></SPAN></P>
  <P class=MsoNormal><SPAN lang=EN-US>I would like to be able to read the file 
  directly under scilab, without using another software.<o:p></o:p></SPAN></P>
  <P class=MsoNormal><SPAN lang=EN-US><o:p> </o:p></SPAN></P>
  <P class=MsoNormal><SPAN lang=EN-US>Is it possible ?<o:p></o:p></SPAN></P>
  <P class=MsoNormal><SPAN lang=EN-US><o:p> </o:p></SPAN></P>
  <P class=MsoNormal><SPAN lang=EN-US>If yes, could you please explain me the 
  procedure ?<o:p></o:p></SPAN></P>
  <P class=MsoNormal><SPAN lang=EN-US><o:p> </o:p></SPAN></P>
  <P class=MsoNormal><SPAN lang=EN-US>Best regards<o:p></o:p></SPAN></P>
  <P class=MsoNormal><SPAN lang=EN-US><o:p> </o:p></SPAN></P>
  <P class=MsoNormal><SPAN lang=EN-US><o:p> </o:p></SPAN></P>
  <P class=MsoNormal><SPAN lang=EN-US 
  style="mso-fareast-language: FR">Loïc<o:p></o:p></SPAN></P>
  <P class=MsoNormal><SPAN lang=EN-US 
  style="mso-fareast-language: FR"><o:p> </o:p></SPAN></P>
  <P class=MsoNormal><SPAN lang=EN-US 
  style="mso-fareast-language: FR"><o:p> </o:p></SPAN></P>
  <P class=MsoNormal><SPAN lang=EN-US 
  style="mso-fareast-language: FR">--<o:p></o:p></SPAN></P>
  <P class=MsoNormal><SPAN lang=EN-US style="mso-fareast-language: FR">Loïc 
  GIROD, Ph.D.<o:p></o:p></SPAN></P>
  <P class=MsoNormal><SPAN style="mso-fareast-language: FR">Ingénieur<BR>- - - - 
  - - - - - - - - - - - - - - - - - - - - - - - - - -<BR>ESSTIN, LEMTA, 
  LPMM<BR>2 rue Jean Lamour<BR>54500 VANDOEUVRE LES NANCY<BR>FRANCE<BR>Tel. : 
  +33 3 83 68 51 44<BR>Port. : +33 6 82 07 98 52<BR>Email. : 
  loic.girod@esstin.uhp-nancy.fr<o:p></o:p></SPAN></P>
  <P class=MsoNormal><o:p> </o:p></P></DIV></BLOCKQUOTE></BODY></HTML>