【问题标题】:fread error? invalid file identifier阅读错误?无效的文件标识符
【发布时间】:2015-03-22 23:21:30
【问题描述】:

在执行时,我有这个错误??使用 ==> fread 时出错 文件标识符无效。使用 fopen 生成有效的文件标识符。 fid 等于 -1 但文件确实存在。 我该怎么办?

seq=dir('C:\Windows\system32\config\systemprofile\Desktop\pfe\code final version 1\nor\info');
N=[];
for i = 3 : length(seq)
disp(seq(i).name)
cd 'C:\Windows\system32\config\systemprofile\Desktop\pfe\code final version 1\nor\info'
fin = fopen('seq(i).name','r');
[x,count]=fread(fin,'char=>char');
cd 'C:\Windows\system32\config\systemprofile\Desktop\pfe\code final version 1'
M=fichier(fin,x);
N=[N;M];
end
xlswrite('info.xls',N);

【问题讨论】:

    标签: excel matlab


    【解决方案1】:

    当您在名称周围加上'' 时,您正在尝试打开一个名为seq(i).name 的文件,删除'' 并使用名为seq(i).name 的变量

    fin = fopen(seq(i).name,'r');
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-04-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-01
      相关资源
      最近更新 更多