help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Load binary data from XML file


From: Matthias Brennwald
Subject: Load binary data from XML file
Date: Thu, 04 Jun 2009 11:33:12 +0200
User-agent: Thunderbird 2.0.0.21 (X11/20090409)

Dear all

I'm trying to get some data in binary format from an XML file into Octave. I tried two approaches:

1. I tried xmlread that comes with Octave forge. This does not like my XML file, so I gave up.

2. I tried XML Tools from Matlab Central ( http://www.mathworks.ch/matlabcentral/fileexchange/1742 ) with its OCT file incarnation discussed at https://www-old.cae.wisc.edu/pipermail/octave-maintainers/2006-June/000277.html . This works nicely by doing the following in Octave:

fid=fopen('~/Desktop/F004.mzML');
s=char(fread(fid,[1,Inf],'char'));
fclose(fid);
list=xmlstruct(char(s));

Now 'list' is a struct containing the different XML elements, including the block of binary data stored in the XML file. However, the corresponding struct element in Octave is a string/char variable containing the hex code, which reflects my binary data. Here's the beginning of the hex code:

APDDxQCkA8YAzAPGAOCwxQBAtcUAbA7GAPDmxQC8GMYAGAjGAIwbxgAo/8UAaPbF...

This should correspond to a series of float numbers. How can I convert this string/char variable into numbers?

Matthias


reply via email to

[Prev in Thread] Current Thread [Next in Thread]