.csv to .mat

조회 수: 4 (최근 30일)
Andy
Andy 2011년 3월 24일
How do I convert .csv files into .mat files. Specifically to interchange new files into the scrips from Algorithmic Trading with MATLAB - 2010 (the webinar). I want to use other files instead of "Bund1min.mat"
Files and webinar:
(Algorithmic Trading with MATLAB - 2010 by Stuart Kozola 22 Nov 2010 (Updated 06 Dec 2010) Code covered by the BSD License Files from the November 18, 2010 webinar.)

답변 (1개)

Walter Roberson
Walter Roberson 2011년 3월 24일
csvread() can be used to load data from csv files. You can then save() the data to a .mat file.
  댓글 수: 4
Andy
Andy 2011년 3월 25일
Maybe it will help if I say step by step what I am trying to do. I download a intra day stock price history csv file from www.stockrageous.com I can either load it into excel to format(I think I have to do this because their is text and a time col. formatted w/ xx:xx) or can try to load the file directly to matlab. When I try to load it into matlab there are errors. I got the excel file to load in and then save as a .mat file when I format the excel file by not having a time col and removing the text headers.
What I want to do: stockrageous.com .csv file to .mat file so it can load through with the for mentioned code.
If anyone needs clarification let me know. Thanks for your help in advance
Walter Roberson
Walter Roberson 2011년 3월 25일
After you have done the load(), ask to output fieldnames(d) as perhaps the data is not stored in a field named 'data'.

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by