73 |
if arg>=9999999999 |
if arg>=9999999999 |
74 |
error(sprintf('Argument %i > 9999999999',arg)) |
error(sprintf('Argument %i > 9999999999',arg)) |
75 |
end |
end |
76 |
if prod(arg>=0) & prod(round(arg)==arg) |
if isnan(arg) |
77 |
|
iters=scanforfiles(fname); |
78 |
|
elseif prod(arg>=0) & prod(round(arg)==arg) |
79 |
iters=arg; |
iters=arg; |
80 |
else |
else |
81 |
error(sprintf('Argument %i must be a positive integer',arg)) |
error(sprintf('Argument %i must be a positive integer',arg)) |
102 |
|
|
103 |
if size(allfiles,1)==0 |
if size(allfiles,1)==0 |
104 |
disp(sprintf('No files match the search: %s.*.meta',fname)); |
disp(sprintf('No files match the search: %s.*.meta',fname)); |
105 |
error('No files found.') |
%allow partial reads% error('No files found.') |
106 |
end |
end |
107 |
|
|
108 |
% Loop through allfiles |
% Loop through allfiles |
331 |
end |
end |
332 |
st=fclose(fid); |
st=fclose(fid); |
333 |
arr=reshape(arr,N); |
arr=reshape(arr,N); |
334 |
|
|
335 |
|
% |
336 |
|
function [iters] = scanforfiles(fname) |
337 |
|
|
338 |
|
allfiles=dir([fname '.*.meta']); |
339 |
|
for k=1:size(allfiles,1); |
340 |
|
hh=allfiles(k).name; |
341 |
|
iters(k)=str2num( hh(end-14:end-5) ); |
342 |
|
end |
343 |
|
|
344 |
|
disp([ sprintf('Reading %i time levels:',size(allfiles,1)) sprintf(' %i',iters) ]); |