Obviously the path is not correct. You can check this easily:
File = fullfile(D, d(k).name, S);
[fid, message] = fopen(File, 'rt');
if fid < 0
fprintf('Not found: %s\n%s\n', File, message);
Z = [];
else
Z=textscan(fid,fmtS,opt{:});
fclose(fid);
end
You are searching for the pattern
/gpfs/gpfs1/scratch/c77777/results/model_standalone_xc/Riffelsee*
In all these folders (or files?!) your search for the files:
/gpfs/gpfs1/scratch/c77777/results/model_standalone_xc/Riffelsee*/runoff.txt
and the error message tells you, that one of these files does not exist. I'm sure Matlab has detected this carefully, so trust the message.
Note: Your code will fail, if you try to access dtS=Z{:,1}, if you have set Z=[].
Best Answer