Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: load part of .mat (fast)
Date: Tue, 22 Jan 2008 18:56:01 +0000 (UTC)
Organization: KTH
Lines: 69
Message-ID: <fn5e81$oek$1@fred.mathworks.com>
References: <fn54b3$13p$1@daniel-new.mch.sbs.de>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1201028161 25044 172.30.248.37 (22 Jan 2008 18:56:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 22 Jan 2008 18:56:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1670
Xref: news.mathworks.com comp.soft-sys.matlab:447034



Andreas Lobinger <newsreturns@biszumknie.de> wrote in 
message <fn54b3$13p$1@daniel-new.mch.sbs.de>...
> 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

save with the '-v6' option is faster since it doesn't 
compress data. / per