Outspan <email@example.com> wrote in message <firstname.lastname@example.org>... > On Oct 20, 1:53?pm, "Bruno Luong" <b.lu...@fogale.findmycountry> > wrote: > > Outspan <borghibor...@gmail.com> wrote in message <32cf3331-9441-4f73-9b6f-f29d3fbf6...@s6g2000vbp.googlegroups.com>... > > > Hi all, > > > > >... ?I also use up 300MB of > > > memory, and I don't understand why. > > > > Because of the REPMAT instruction. > > > > > bars = struct('date', , 'time', , 'open', , 'high', , 'low', > > > , 'close', , 'volume', ); > > > bars = repmat(bars, [1 500000]); > > I wrote earlier that I had 50K lines, but I really have 500K (so the > parameters in repmat are correct). Is there a way to do this and use > less memory? How come the .mat file is only 10MB but the script is > using this much memory?
The .MAT files are compressed, while in memory, the data is raw (decompressed).
About the memory usage after loading the MAT file: what is the output of your 'whos' for the relevant matrix?