cat12
cat12 copied to clipboard
cat_main_report error
I use CAT12.9 to preprocess a dataset from Linux command line (matlab -batch). Processing does not generate the .pdf reports when used without GUI. I tried to re-generate these reports using cat_main_report, but run into an error:
>> job.files{1} = 'cat_sub-3556_ses-V06_I372345.xml'
job =
struct with fields:
files: {'cat_sub-3556_ses-V06_I372345.xml'}
>> cat_main_report(job )
Index exceeds the number of array elements (0).
Error in cat_main_report (line 91)
if isfield( job, 'Pp0' ) && iscell(job.Pp0) && ~isempty( job.Pp0{1} ) && ~isempty( job.Pp0{1} ) && exist( job.Pp0{fi} , 'file' )
Is this the right way to get the report, or am I doing something wrong?
Thank you for your support!
I guess that I found the problem. In cat_main_report.m, change line 91:
% if isfield( job, 'Pp0' ) && iscell(job.Pp0) && ~isempty( job.Pp0{1} ) && ~isempty( job.Pp0{1} ) && exist( job.Pp0{fi} , 'file' )
if isfield( job, 'Pp0' ) && iscell(job.Pp0) && ~isempty( job.Pp0 ) && ~isempty( job.Pp0{1} ) && exist( job.Pp0{fi} , 'file' )
Expression 3 and 4 are identical, and they should not be. First test that Pp0 is not empty, and afterwards test for Pp0{1} to be present.
Best, Thomas