what is the error 'Error using fscanf Invalid file identifier. Use fopen to generate a valid file identifier.'
4 次查看(过去 30 天)
显示 更早的评论
after coding this
clear
clc
k=1:25:601;
for i=1:numel(k)
basefilename=sprintf('porosity_k%d',k(i));
fullfilename=fullfile(basefilename);
fileid= fopen(fullfilename,'r+')
A(:,i)=fscanf(fileid,'%f')
fclose(fileid)
end
B=cat(1,A(:,1),A(:,2),A(:,3),A(:,4),A(:,5),A(:,6),A(:,7),A(:,8),A(:,9),A(:,10),...
A(:,11),A(:,12),A(:,13),A(:,14),A(:,15),A(:,16),A(:,17),A(:,18),A(:,19),A(:,20),...
A(:,21),A(:,22),A(:,23),A(:,24),A(:,25));
i get this error
Error using fscanf Invalid file identifier. Use fopen to generate a valid file identifier
please help me why i get this error
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File 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!