Error Reading Data From File

1 次查看(过去 30 天)
inteli
inteli 2020-9-2
评论: inteli 2020-9-17
Dear all,
Please I need advice on the error as stated in the title.
After inputing the coloumn for Matlab to read from the data file it reutrned the error
Error using fgets
Invalid file identifier. Use fopen to generate a valid file identifier.
Error in fgetl (line 32)
[tline,lt] = fgets(fid);
Error in readFmt>fgetlRF (line 347)
out=fgetl(fidIn);
Error in readFmt (line 121)
dataLine=fgetlRF(fidIn); if dataLine==-1, readEndFlag=true; return; end
I would be grateful.
  2 个评论
KSSV
KSSV 2020-9-2
Show us the full code which you tried....see to it that file is accessible/ in the same folder for successfull reading. Check the value of fid, it should be greater than 2.
inteli
inteli 2020-9-17
Thank you KSSV for the reply. I have sorted it out. It was compatibility issues. Ran the code on another system and it worked.
However, can you advice me on this challenge?
I have two sets of column data (about 120 data points each), d(:,1) and c(:,2).
How do I use the 'for' and 'if' loop commands to evaluate the difference between each of the points in the variables (that is, say E = d - c) and then compare each of the outcome with an error value computed already to produce another column data of results less than the error benchmark.
I would be grateful.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Low-Level File I/O 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by