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 (최근 30일)
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
mich
mich 2016년 9월 27일
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.

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2016년 9월 27일
  댓글 수: 3
mich
mich 2016년 9월 27일
Thanks Walter, would that be the best way to also update 4-D and 5-D double arrays?

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

dpb
dpb 2016년 9월 27일
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...

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by