Q:

Assume that a file named testread.dat stores the following:

0

110x0.123y5.67z8.45

120x0.543y6.77z11.56

Assume that the following are typed SEQUENTIALLY. What would the 

values be?

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

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

total answers (1)

Similar questions


need a help?


find thousands of online teachers now