How do I append data to an existing datafile? I don't want to overwrite any data, just simply add to it - is there a specific append or concat function i can use?

3 visualizaciones (últimos 30 días)
I have a data file with several arrays of financial data, prices, interest rates, etc on 43 different stocks, i'd like to add more data so that the data is up to date. Is there any way to append more data to the end of my current data file?
  1 comentario
mich
mich el 27 de Sept. de 2016
Let me give more information as I wrote the question way too briefly. I currently have a data.mat file which I use for an analytical model. In the data.mat file, I have several arrays of data such as spot prices, fwd prices, volatilities, and spreads. Many of the arrays are 3-d or 4-d double arrays, and line up against a specific day, that ended at the beginning of the year. I'm trying to figure out the best way to update my entire data set and am looking for tips on how to start out by appending (or concating) the simpler arrays before looking to do the same for the multi dimensional arrays.

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 27 de Sept. de 2016
  3 comentarios
mich
mich el 27 de Sept. de 2016
Thanks Walter, would that be the best way to also update 4-D and 5-D double arrays?

Iniciar sesión para comentar.

Más respuestas (1)

dpb
dpb el 27 de Sept. de 2016
In what form does this file exist? In general, for text files you can use fopen w/ the append mode switch but you'll have to be somewhat careful in how you write new data; if the data are stored as a record per data point then you can add more pretty easily but if there are simply arrays of the various variables written, then it'll be more difficult to keep "who's who in the zoo" straight when you get ready to read the amended file later on.
In short, "not enough information" to answer fully...

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by