Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Load csv with date-time column and other colums with numbers and changing date-time to number.
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello, I have csv file of stock data that has around 5000 rows and looks like this:
timestamp,open,high,low,close,volume 2017-11-03,5.7000,5.9400,5.6300,5.7500,822395 2017-11-02,5.6100,5.8100,5.5500,5.7800,1120941 2017-11-01,5.4600,5.6300,5.4400,5.6200,717112
Now I would like to load it into matrix, but timestamps i would like to change to some number and then i would like to be able to easily transform this number back to timestamp.
댓글 수: 0
답변 (1개)
KL
2017년 11월 21일
편집: KL
2017년 11월 21일
If you have 2013b or later use readtable,
data = readtable('filename.csv');
your first column will have datetime format by default (if your data is properly formatted), you can modify a specific row by
data.timestamp(your_row) = some other date here
then you use writetable if you want to export the updated data to csv
writetable(data,'filename.csv');
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!