필터 지우기
필터 지우기

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일
Are those "--" actually present, or do they represent spaces?

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

답변 (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 ?
vx2008
vx2008 2013년 3월 22일
thanks at all

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

카테고리

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