Re: Adding to matrices in mat file



"Steve Hall" <cosmicfish@xxxxxxxx> wrote in message <gpr1f9$hqt$1@xxxxxxxxxxxxxxxxxx>...
Question: Is it possible to sequentially append values to a vector or matrix in a mat file, without opening said mat file?

Example:

a=[1 2 3 4 5]
save 'afile.mat' a

a=6 or a(6)=6 as needed

somehowappendthisthing('afile.mat',a)

load 'afile.mat'

a=[1 2 3 4 5 6]



Any ideas? Holding the whole matrix in memory while doing the computation is dragging things down but I need the data at the end.

I doubt you can't append anything to any file without opening the file.
But if you mean append without reading the contents of the file, then if you only need a simple array you could write it to a binary file. There you can add stuff without reading the existing content.
doc fopen
doc fwrite
.



Relevant Pages

  • Re: Programming in standard c
    ... I consider having the text file size used for reading the file into ... memory to be used insufficiently often to make it worth caching it. ... size may suck significantly more than getting the binary-mode size ... NOT precalculate the size) and reallocing when needed ...
    (comp.lang.c)
  • Re: Noise Level of the PowerMac G5
    ... Or is it just a little bit more memory slots, ... If you are spending most of your time reading, thinking and editing ... I may have 10 to 15 apps open at once and switching between them a lot, ...
    (comp.sys.mac.misc)
  • Re: Large text file - in memory ( > 60mb)
    ... The file is over 64mb in size, reading it line by line to do a search ... while running the app, it would mean reading/searching the>64mb file many ... Then I have to show this record found (wich ... maybe creating a datatable to ease the search but I'm pretty sure memory ...
    (microsoft.public.dotnet.framework)
  • Re: Off Topic: Memory
    ... Given that my memory is something of a concern to me, ... I've only just started reading it but it addresses the causes ... - the rather haphazard way our brains are built, sort of like kludged ... P.S. haven't tried the test yet - keep forgetting ...
    (rec.music.makers.guitar.acoustic)
  • Re: Programming in standard c
    ... may grow larger between the query and the reading. ... That wider programming environment can provide guarantees ... and learned my craft in the days when memory was ...
    (comp.lang.c)