clear; clc;
fid = fopen('Data01.txt');
tline = fgetl(fid);
x = 1;
while ischar(tline)
data01{x} = tline;
tline = fgetl(fid);
x = x + 1;
end
fclose(fid);
id1 = 1; id2 = 1;
querystr1 = 'surface(21<12<13)';
querystr2 = 'cosinebin:-8.72000E-02to-3.66000E-02';
for x = 1 : length(data01)
tmpdata = regexprep(data01{x},' ','');
if strcmp(tmpdata,querystr1) == 1
linestr1(id1) = x; id1 = id1 + 1;
end
if strcmp(tmpdata,querystr2) == 1
linestr2(id2) = x; id2 = id2 + 1;
end
end
for x = 1 : length(linestr1)
for y = 1 : length(linestr2)
diff = abs(linestr1(x) - linestr2(y));
if diff == 1
lowintv = linestr2(y) + 2;
end
end
end
idk = 1;
idl = lowintv;
while ~any(findstr(data01{idl},'total'));
data02{idk} = textscan(data01{idl},'%f %f %f');
idk = idk + 1;
idl = idl + 1;
end
Best Answer