Hi I am debugging a set of matlab codes.
in code below if I comment out the second line I get the error that "Invalid file identifier. Use fopen to generate a valid file identifier." and I do not understand the role of second line because later on it will never be used?!!
Besides, I do not understand the two lines to the end
fid=fopen('ID.dat');line=fgetl(fid);rep=fscanf(fid,'%s',1);fclose('all');fid=fopen([rep,filesep,'Nemoh.cal'],'r');for i=1:6 ligne=fgetl(fid);endnBodies=fscanf(fid,'%g',1);fclose(fid);fid=fopen([rep,filesep,'Nemoh.cal'],'r');n=1;clear textline;textline={};
Best Answer