Menu

Appending data continuously to a mat file

cJ
2009-08-12
2013-10-30
  • cJ

    cJ - 2009-08-12

    Hi,

    For a lot of reasons, writing to .mat files is a little less dumb than writing to CSV files...
    However, I did not find (maybe I didn't look too well) a way to append a row of data in an array in the API docs.

    Is there such a way ?

    Regards,

     
    • cJ

      cJ - 2009-08-13

      NB : at the moment, I'm a happy user of matio and I get the functionality I want (which may be too specific/hacky to be included in the lib) in a wrapping library.

       
  • Anonymous

    Anonymous - 2012-04-24

    I have exactly the same question. Did you manage to do this?

    Or asking the devs: Is this possible? I did not find it in the documentation…

    Thanks

     
  • cch

    cch - 2012-04-24

    matio is not set up for streaming unknown amounts of data to a file. Perhaps you can get what you want using HDF5 directly via extendible datasets (http://www.hdfgroup.org/HDF5/Tutor/extend.html). Also, MATLAB uses column-major so adding a row would be very expensive.

     
  • Anonymous

    Anonymous - 2012-04-25

    ok, thanks for your answer!

     
  • Guenter Schreiber

    Hi there,
    I've got a similar problem.
    We collect data to a ringbuffer, so
    - the data size is known
    - but the datas representation within the memory is not continous (due to the nature of the ringbuffer)

    So I'd require to write in sequence:
    - "the header" of the mat-data controlstructure
    - the "first chunk" of the data (the "upper part" of the ringbuffer)
    - the "second chung" of the data (the "lower part" of the ringbuffer)

    Would that be possible with that nice software?
    What effort would that be?

    Thanks in Advance

    guenter

     
    • Scott

      Scott - 2013-10-30

      If you still need this, I believe it can be done with matio in it's current state. Take a look at the "writeslab" test in "test_mat.c" code. What you want to look at is how it calls "WriteDataSlab2" under the covers, which allows you to write any section of a 2-dimensional MatLab variable into a file. The current implementation requires that the variable NOT be complex, however.

      I warn you, the example used in the "writeslab" example is... insufficient. You will need to tweak it to do what you want, but it shouldn't be hard. We are doing that here.

       

      Last edit: Scott 2013-10-30

Log in to post a comment.