请大家帮忙,如何将txt格式的数据导入matlab
第一列为日期,想导入成一个两列的矩阵2005-07-12 7.87
2005-07-13 7.73
2005-07-14 7.77
2005-07-15 7.79
2005-07-18 7.89
2005-07-19 7.92
2005-07-20 7.90
2005-07-21 7.92
2005-07-22 8.18
2005-07-25 8.27
2005-07-26 8.31
2005-07-27 8.30
2005-07-28 8.28
2005-07-29 8.34
2005-08-01 8.13
2005-08-02 8.21
2005-08-03 8.22
2005-08-04 8.19
2005-08-05 8.42
2005-08-08 8.47
2005-08-09 8.50
2005-08-10 8.65
2005-08-11 8.76
2005-08-12 8.51
2005-08-15 8.65
2005-08-16 8.49
2005-08-17 8.55
2005-08-18 8.23
2005-08-19 8.38
2005-08-22 8.38
2005-08-23 8.30
2005-08-24 8.47
2005-08-25 8.52
2005-08-26 8.51
2005-08-29 8.45
2005-08-30 8.46
2005-08-31 8.48
2005-09-01 8.62
2005-09-02 8.63
2005-09-05 8.56
2005-09-06 8.40
2005-09-07 8.44
2005-09-08 8.54
2005-09-09 8.48
2005-09-12 8.61
2005-09-13 8.64
2005-09-14 8.85
2005-09-15 8.86
2005-09-16 8.90
2005-09-19 8.85
2005-09-20 8.71
2005-09-21 8.49
2005-09-22 8.27
2005-09-23 8.17
2005-09-26 8.21
2005-09-27 8.06
2005-09-29 8.18
2005-09-30 8.30
2005-10-10 8.39
2005-10-11 8.47
2005-10-12 8.50
2005-10-13 8.50
2005-10-14 8.23
2005-10-17 8.30
2005-10-18 8.15
2005-10-19 8.40
2005-10-20 8.78
2005-10-21 8.72
2005-10-24 8.73
2005-10-25 8.61
2005-10-26 8.33
2005-10-27 8.30
2005-10-28 8.30
2005-10-31 8.52
2005-11-01 8.60
2005-11-02 8.54
2005-11-03 8.20
2005-11-04 8.30
2005-11-07 8.16
2005-11-08 8.29
2005-11-09 8.37
2005-11-10 8.29
2005-11-11 8.33
2005-11-14 8.13
2005-11-15 8.15
2005-11-16 8.26
2005-11-17 8.26
2005-11-18 8.65
2005-11-21 8.61
回复:(rucmathlsj)请大家帮忙,如何将txt格式的数据...
fid=fopen('d:\stock.txt','r');tline=fgetl(fid);
str1=tline(1:10);
str2=str2num(tline(11:15));
while ~feof(fid)
tline=fgetl(fid);
str1=;
str2=;
end
str1
str2
回复:(rucmathlsj)请大家帮忙,如何将txt格式的数据...
两列的数据类型不一样,不能放在同一个矩阵中 可以建立函数,然后在不同的数值下,调用该函数,就可以了
页:
[1]