Path: news.mathworks.com!newsfeed-00.mathworks.com!kanaga.switch.ch!switch.ch!news-fra1.dfn.de!news0.de.colt.net!newsfeed2.sbs.de!news.mch.sbs.de!not-for-mail
From: Andreas Lobinger <newsreturns@biszumknie.de>
Newsgroups: comp.soft-sys.matlab
Subject: load part of .mat (fast)
Date: Tue, 22 Jan 2008 17:06:59 +0100
Organization: no org
Lines: 59
Message-ID: <fn54b3$13p$1@daniel-new.mch.sbs.de>
NNTP-Posting-Host: demmef9c.nsn-intra.net
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: daniel-new.mch.sbs.de 1201018019 1145 10.148.17.151 (22 Jan 2008 16:06:59 GMT)
X-Complaints-To: abuse@siemens.de
NNTP-Posting-Date: Tue, 22 Jan 2008 16:06:59 +0000 (UTC)
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040514
X-Accept-Language: en-us, en
Xref: news.mathworks.com comp.soft-sys.matlab:446986



Aloha,

in my field of work (simulation) you can get pretty fast
pretty large amounts of data.

In one of our tools therefore we use the append option of
save to save consecutive buffers to a .mat file.

The file then contains something like
buff_0
buff_1
buff_2
buff_3
etc.

with a structure told by whos
 >> pre = whos('-file','/homes/lobingera/Channel.SINR.mat')

pre =

57x1 struct array with fields:
     name
     size
     bytes
     class
     global
     sparse
     complex
     nesting

 >> pre(1)

ans =

        name: 'buff_0'
        size: [1260 50 100]
       bytes: 50400000
       class: 'double'
      global: 0
      sparse: 0
     complex: 0
     nesting: [1x1 struct]

We have a function to read it back again to memory by concatenating
the buffers.

At the moment i'm extending this facility to read only some of the
buffers.

The problem is:
load('filename.mat','buff_0','buff_1)
has somehow linear search time.
If i read n variables, it will need time n. If i read the file
completely it will need only time ~1.5.

Is there a 'fast' method to read consecutive parts of a .mat file?

Hoping for an answer and wishing a happy day,
		LOBI