how to made a ".mat" file from ".txt"

1 次查看(过去 30 天)
vx2008
vx2008 2013-3-22
the ".txt" file's content is as below:
Date--------OpenPrice------HighPrie-----LowPrice----ClosePrice------Volume
2012/3/8----6.18-------------6.28-----------5.68-----------6.09-----89573650
2012/3/9----6.01-------------6.21-----------5.95-----------6.03----895738396
2012/3/12--6.03-------------6.09-----------5.87-----------6.89----895738698
2012/3/13--5.9--------------6.16------------5.9------------6.04-----895738356
Just now I load "disney.mat" in matlab conmmand window and I find that there are 8 variables in total as below:
dis <782 X 5 fints>
dis_CLOSE <782 X 1 double> NaN
dis_HIGH <782 X 1 double> NaN
dis_LOW <782 X 1 double> NaN
dis_OPEN <782 X 1 double> NaN
dis_VOLUME <782 X 1 double> NaN
dis_nv <782 X 4 fints>
q_dis <13 X 4 fints> NaN
how can I get '.mat'like this

回答(1 个)

Walter Roberson
Walter Roberson 2013-3-22
You cannot get that desired output from that input. You have matches for dis_CLOSE, dis_HIGH, dis_LOW, dis_OPEN, and dis_VOLUME, which leaves only the one column "Date" to account for dis (which has 5 items of information per line) and dis_nv (which has 4 items of information per row) and q_dis (which has a completely different number of rows than anything else.)
  3 个评论
Walter Roberson
Walter Roberson 2013-3-22
I do not know. Is it possible that the 5 fints stored in "dis" corresponds to the 5 columns of values, such as OpenPrice and HighPrie ?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by