How do I fix this for regression analysis? Error message: Error in analysis spm_jobman('run', jobfile);

Hi,
The first error message i got was:
Error using spm_jobman>fill_run_job
No executable modules, but still unresolved dependencies or incomplete module inputs.
Error in spm_jobman (line 247)
sts = fill_run_job('run', cjob, varargin{3:end});
Error in analysis_regress_ptsd (line 75)
spm_jobman('run', jobfile);
Solved this by typing in line 75:
spm_jobman('run', analysis_regress_ptsd_job.m);
Now I got the error:
>> analysis_regress_ptsd
Found 80 subjects to analyze
Unable to resolve the name 'analysis_regress_ptsd_job.m'.
Error in analysis_regress_ptsd (line 75)
spm_jobman('run', analysis_regress_ptsd_job.m);
Is someone familiar with this? I'm not familiar with this program (code language), if it helps line 74 says;
%Run all the jobs using the SPM job manager
Any help will be greatly appreciated.
Regards, Marjolein

Answers (1)

The error message you're encountering indicates that MATLAB is unable to find the file analysis_regress_ptsd_job.m, which is referenced in line 75 of your code. This error typically occurs when the file is not located in the current working directory or is misspelled.
To resolve this issue, you can try the following steps:
  • Verify that the file analysis_regress_ptsd_job.m is present in the current working directory or in a directory accessible to MATLAB using the code provided below.
% Load or create the analysis_regress_ptsd_job variable/structure
% Make sure it contains the necessary job information
% Check if the variable exists
if ~exist('analysis_regress_ptsd_job', 'var')
error('analysis_regress_ptsd_job variable is not defined.');
end
% Run the job using the SPM job manager
spm_jobman('run', analysis_regress_ptsd_job);
  • Double-check the spelling and case sensitivity of the filename. Ensure that it exactly matches the filename in the directory.
  • If the file is located in a different directory, you need to provide the full path to the file in the spm_jobman function call. For example:
spm_jobman('run', '/path/to/analysis_regress_ptsd_job.m');
  • If you are working with a script or function that calls analysis_regress_ptsd_job.m, make sure the function or script is in the same directory as analysis_regress_ptsd_job.m or in a directory accessible to MATLAB.
I hope this helps you solve the encountered error.

1 Comment

I'm happy to say that I got it before your answer, but your answer was indeed valid. Thank you so much for taking the time to explain it to me!

Sign in to comment.

Categories

Find more on MATLAB in Help Center and File Exchange

Products

Release

R2022a

Asked:

on 6 May 2023

Commented:

on 29 Jun 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!