cd(curdir); files = splitstring(dir,endl); for(i=1:length(files)) { file_to_check = files{i}; hpc_file_check; # input variables: file_to_check, fname, curdir; output: none or break }