dir_MLEfit_ott.m 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. function dir_MLEfit_ott(task)
  2. % task should be a string
  3. % standard: 50% suc/malto
  4. % threeOutcomes: suc/malto/water
  5. % cued: suc/mal-predictive cue
  6. master_root = ottBari2020_root();
  7. allTasks = {'intBlocks','threeOutcomes','cue'};
  8. taskMask = contains(allTasks, task);
  9. if all(~taskMask) == 1 % task no found
  10. error('task name not found')
  11. else
  12. % change directory to appropriate directory
  13. cd(fullfile(master_root, 'MatlabScripts', '2_Modeling', allTasks{taskMask}, 'fit_model'))
  14. % add path of appropriate model
  15. addpath(fullfile(master_root, 'MatlabScripts', '2_Modeling', allTasks{taskMask}, 'fit_model', 'RWmodels_RPE'))
  16. addpath(fullfile(master_root, 'MatlabScripts', '2_Modeling', allTasks{taskMask}, 'fit_model', 'RWmodels_value'))
  17. % remove all other paths
  18. for nonTaskInd = find(~taskMask)
  19. rpe_path = fullfile(master_root, 'MatlabScripts', '2_Modeling', allTasks{nonTaskInd}, ...
  20. 'fit_model', 'RWmodels_RPE');
  21. if contains(path, rpe_path)
  22. rmpath(rpe_path)
  23. end
  24. value_path = fullfile(master_root, 'MatlabScripts', '2_Modeling', allTasks{nonTaskInd}, ...
  25. 'fit_model', 'RWmodels_value');
  26. if contains(path, value_path)
  27. rmpath(value_path)
  28. end
  29. end
  30. end