help
help > fprintf error when running batch script
Jun 4, 2019 01:06 AM | Matt Price
fprintf error when running batch script
Hi Conn Forum,
I'm a new user and am encountering an error when attempting to run a conn batch script. I have data that was preprocessed using the HCP pipelines and I would like to use the conn_batch_humanconnectomeproject.m script to import the data into conn. I have made the appropriate modifications to the script so that it finds my files (e.g., changed the names and number of resting state scans).
When I run the script, my files are found and read correctly - but then I quickly get this error?
%%%%%%%%%%%%%%%%%%%%%%%%
Error using fprintf
Invalid file identifier. Use fopen to generate a valid file identifier.
Error in conn_disp (line 162)
for n=1:numel(str), fprintf(fh,'%s\n',str{n}); end
Error in conn_process (line 27)
case 'setup_preprocessing', conn_disp(['CONN: RUNNING SETUP.PREPROCESSING STEP']); conn_setup_preproc(varargin{:});
Error in conn_batch (line 1099)
conn_process('setup_preprocessing',steps,'subjects',SUBJECTS,OPTIONS{:});
162 for n=1:numel(str), fprintf(fh,'%s\n',str{n}); end
%%%%%%%%%%%%%%%%%%%%%%%%
Using the real-time debugger in matlab, it appears that a file is attempting to be opened by fprintf. This file is taken from line 160-161 of the conn_disp.m:
%%%%%%%%%%%%%%%%%%%%%%%%
filename=fullfile(conn_prepend('',conn_projectmanager('projectfile'),''),'logfile.txt');
fh=fopen(filename,'at');
%%%%%%%%%%%%%%%%%%%%%%%%
It appears that conn is trying to open the log file, but this log file does not exist. I'm assuming that it should have been created in an earlier step that I may have neglected to complete. Any help that could be offered is appreciated!
-Matt
I'm a new user and am encountering an error when attempting to run a conn batch script. I have data that was preprocessed using the HCP pipelines and I would like to use the conn_batch_humanconnectomeproject.m script to import the data into conn. I have made the appropriate modifications to the script so that it finds my files (e.g., changed the names and number of resting state scans).
When I run the script, my files are found and read correctly - but then I quickly get this error?
%%%%%%%%%%%%%%%%%%%%%%%%
Error using fprintf
Invalid file identifier. Use fopen to generate a valid file identifier.
Error in conn_disp (line 162)
for n=1:numel(str), fprintf(fh,'%s\n',str{n}); end
Error in conn_process (line 27)
case 'setup_preprocessing', conn_disp(['CONN: RUNNING SETUP.PREPROCESSING STEP']); conn_setup_preproc(varargin{:});
Error in conn_batch (line 1099)
conn_process('setup_preprocessing',steps,'subjects',SUBJECTS,OPTIONS{:});
162 for n=1:numel(str), fprintf(fh,'%s\n',str{n}); end
%%%%%%%%%%%%%%%%%%%%%%%%
Using the real-time debugger in matlab, it appears that a file is attempting to be opened by fprintf. This file is taken from line 160-161 of the conn_disp.m:
%%%%%%%%%%%%%%%%%%%%%%%%
filename=fullfile(conn_prepend('',conn_projectmanager('projectfile'),''),'logfile.txt');
fh=fopen(filename,'at');
%%%%%%%%%%%%%%%%%%%%%%%%
It appears that conn is trying to open the log file, but this log file does not exist. I'm assuming that it should have been created in an earlier step that I may have neglected to complete. Any help that could be offered is appreciated!
-Matt
Threaded View
Title | Author | Date |
---|---|---|
Matt Price | Jun 4, 2019 | |
Matt Price | Jun 4, 2019 | |
veldter | Oct 28, 2019 | |