Filter löschen
Filter löschen

what is the error 'Error using fscanf Invalid file identifier. Use fopen to generate a valid file identifier.'

1 Ansicht (letzte 30 Tage)
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

Antworten (0)

Kategorien

Mehr zu Low-Level File I/O finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by