fgetl - still a valid function?
Show older comments
I am trying to adapt someonelse's old (~2010) code for my use (run monte carlo of another program) . The old code uses the function "fgetl"
%READ HYDRUS OUTPUT FILES - This block reads for all the realizations of
%the Nod_inf.out file and stores the water content profiles for t=10 days in Prof_out table.
prof_out=zeros(101,num_sim+1);
for i=1:num_sim
fileID_out=fopen(strcat(path{i},'\nod_inf.out'));
skip_lines=123;
for k=1:(skip_lines)
x=fgetl(fileID_out);
end
temp=fscanf(fileID_out,'%f',[11,101])';
prof_out(:,i+1)=temp(:,4);
fclose(fileID_out);
end
prof_out(:,1)=temp(:,2);
But I keep getting the following error:
Error in fgetl (line 32)
[tline,lt] = fgets(fid);
Error in PAFBHydrusMC (line 144)
x=fgetl(fileID_out);
Why? I have double checked that it is writen with a lower case "L" and not the number 1... Thanks for any direction on this!
Accepted Answer
More Answers (0)
Categories
Find more on Low-Level File I/O in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!