- 积分
- 64
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2019-3-1
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
fid1=fopen('C:\Users\LENOVO\Desktop\ECMWF\Asia.txt');
fid2=fopen('C:\Users\LENOVO\Desktop\Asia.txt');
[A,B,C,D,E,F,G]=textread('C:\Users\LENOVO\Desktop\ECMWF\Asia.txt','%d %f %d %f %f %f %f');
[AA,BB,CC,DD,EE,FF,GG] =textread('C:\Users\LENOVO\Desktop\Asia.txt','%d %f %d %f %f %f %f');
i=1;
j=1;
m=1;
n=1;
while ~feof(fid1)
if F(i)>21&&F(i)<22&&G(i)>68&&G(i)<69
K(j)=D(i);
L(j)=E(i);
j=j+1;
end
i=i+1;
end
while ~feof(fid2)
if FF(m)>21&&FF(m)<22&&GG(m)>68&&GG(m)<69
KK(n)=DD(m);
LL(n)=EE(m);
n=n+1;
end
m=m+1;
end
plot(E,D,'b-');
hold on
plot(EE,DD,'r-');
hold off
grid on
遇到这样的错误:
错误使用 dataread
Trouble reading integer from file (row 1, field 3) ==> .2 1 0.11074210.6 17.40300610.6 -7
出错 textread (line 174)
[varargout{1:nlhs}]=dataread('file',varargin{:}); %#ok<REMFF1>
出错 Asia (line 3)
[A,B,C,D,E,F,G]=textread('C:\Users\LENOVO\Desktop\ECMWF\Asia.txt','%d %f %d %f %f %f %f');
我的数据格式没问题啊,为什么会这样报错呢??
数据格式大概这种
1 0.5900005.2 13 3.77968610.6 6.74318910.6 -7.97384615.10 64.78241415.10
1 0.5900005.2 14 4.43311510.6 5.45036810.6 -7.97384615.10 64.78241415.10
1 0.5900005.2 15 5.13584410.6 4.57826610.6 -7.97384615.10 64.78241415.10
1 0.5900005.2 1 0.14943010.6 10.02123910.6 21.92241115.10 68.15256815.10
1 0.5900005.2 2 0.34844610.6 9.40953110.6 21.92241115.10 68.15256815.10
1 0.5900005.2 3 0.57100510.6 8.46060410.6 21.92241115.10 68.15256815.10
|
|