From: Rune Allnor <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: decoding floating point binary data from an HP impedance analyzer
Date: Mon, 28 Sep 2009 12:41:16 -0700 (PDT)
Lines: 28
Message-ID: <>
References: <h5s610$fvr$> <h5sg9m$4rk$> 
	<h5sgkr$rsk$> <h9gtuv$kmp$> 
	<h9jt40$oid$> <h9r207$m2p$>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: 1254166876 27140 (28 Sep 2009 19:41:16 GMT)
NNTP-Posting-Date: Mon, 28 Sep 2009 19:41:16 +0000 (UTC)
Injection-Info:; posting-host=; 
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; 
	Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; 
	.NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe)
Xref: comp.soft-sys.matlab:573463

On 28 Sep, 21:15, "Mikael Evander" <> wrote:
> Right. I'm connected to the instrument again and extracted some data. To start with what's working, I told the instrument to transfer the data in ascii format, read it with fscanf(g) and converted it using str2num. What you get then are the correct values and they look like this:


Does the instrument store the data internally? If so, can the same
data be exported several times at different formats?

If 'yes' export the data first on ASCII format, and then once
again as floating point format. Then post the ASCII printout
and the corresponding floating-point value as hex numbers:

1) Open the binary file using

fid = fopen(filename,'rb');

2) Read the first floating point binary value from the file,

fpv = fread(fid,[1,1],'float32');

3) Write the value on hex format: