Assume that a file named testread.dat stores the following:
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:9| Question number:17.9
All Answers
total answers (1)
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:9| Question number:17.9
total answers (1)
tstid = fopen('testread.dat')
fileline = fgetl(tstid)
[beg, endline] = strtok(fileline,'y')
length(beg)
feof(tstid)
>> tstid = fopen('testread.dat')
tstid =
%some integer value, depending on how many files are open
>> fileline = fgetl(tstid)
fileline =
110x0.123y5.67z8.45
>> [beg, endline] = strtok(fileline,'y')
beg =
110x0.123
endline =
y5.67z8.45
>> length(beg)
ans =
9
>> feof(tstid)
ans =
0
need an explanation for this answer? contact us directly to get an explanation for this answer