Hi! Could somebody tell me why few days ago this code worked and now I tried it again and gives me this error? Thank you!
3 views (last 30 days)
Show older comments
fmt=['PG10 ' repmat('%f ',1,8)];
fid=fopen('sp3data.txt');
PG10=[];
while ~feof(fid)
l=fgetl(fid); % read a record
if strfind(l,'PG10')
PG10=[PG10; cell2mat(textscan(l,fmt,'collectoutput',1))];
end
end
fclose(fid);
Error using feof
Invalid file identifier. Use fopen to generate a valid file identifier.
0 Comments
See Also
Categories
Find more on Variables in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!