如何从文件中每隔10行去读取文件
fid=fopen('D:\rock physics\Data\vppro.txt','r');%%读取vp-porosity数据p=0;
while ~feof(fid)
p=p+1;
tline = fgetl(fid);
w=sscanf(tline,'%f');
depth(p)=w(1);
phi(p)=w(2)/100;
vp(p)=w(3)/1000;
end
这样是每一行都读数据,如何每隔10行去读取数据呢,请教高手 fid=fopen('D:\rock physics\Data\vppro.txt','r');%%读取vp-porosity数据
p=0;
while ~feof(fid)
p=p+10;
tline = fgetl(fid);
w=sscanf(tline,'%f');
depth(p)=w(1);
phi(p)=w(2)/100;
vp(p)=w(3)/1000;
end
页:
[1]