Re: converting uint8 arrays to integers, floats an
- From: PB <pbodin@xxxxxxxxxxxxxxxxxxx>
- Date: Mon, 24 Oct 2005 15:59:16 -0400
William L. Slater wrote:
>
>
> Hey Matlab Family:
>
> I've got to process some files FTP'd from a VAX machine. In these
> files are various types of data: bytes, short integers, long
> integers, floats, and doubles. Parsing the data off by category is
> no problem, but interpreting them is. For instance, a page of data
> might be formated as follows: double(1), byte(3), short(1),
> long(1),
> byte(5), double(1). And there might be 200000 pages in a file.
>
> I can fread all the raw data from the file, and reshape it to match
> the number of pages (columns). Thus, I can parse of this matrix by
> rows for each category of data: the first 8 rows represent the
> first
> double category, the next three for the 3 bytes, and so on.
>
> Is there a way that I can convert these groups of rows to their
> respective data type? What I've been doing so far is using frwite
> to
> write each group of rows to a temp file and fread them back in with
> the appropriate format. This gives me the results I want, but when
> dealing with dozens of data categories and hundreds of thousands of
> pages it can take a long time. Is there a way to do this in
> memory?
>
>
> Oh, BTW, I've seen the uread file in the File Exchange. I'm not
> sure
> if it can read floats and doubles in the 'vaxg' format that I need,
> like fread does.
>
> Any help would be greatly appreciated. Thanks
Hi William.
I don´t know if this will help in your case, but in ML7 there is a
function called memmapfile which seems appropriate for this kind of
work. Unfortunately I don´t have any experience in using it. In this
thread:
<http://tinyurl.com/a3kze>
Jesper Göransson showed how he used it.
HTH
PB
.
- References:
- converting uint8 arrays to integers, floats and doubles
- From: William L. Slater
- converting uint8 arrays to integers, floats and doubles
- Prev by Date: Matlab Compiler 4.0 Exception
- Next by Date: Re: Elementary programming question
- Previous by thread: converting uint8 arrays to integers, floats and doubles
- Next by thread: Re: converting uint8 arrays to integers, floats and doubles
- Index(es):
Relevant Pages
|