Fig1D.m 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. %% Figure 1D - Task performance
  2. %
  3. clear all
  4. close all
  5. %%
  6. %Inital learning
  7. Hit_P = [0.7619 0.9762 0.9762 1 1 1]; %Initial Hit
  8. FA_P = [0.9184 1 0.8367 0.1633 0.04 0.0408]; %Initial FA
  9. CatchFA_P = [0.8163 1 0.6735 0.2041 0.0612 0.0816]; %Initial catchFA
  10. %Reversal learning
  11. Rev_Hit_P = [0.0476 0.9762 1 1 1]; %Reversal Hit
  12. Rev_FA_P = [0.3265 1 0.7188 0.3673 0.4082]; %Reversal FA
  13. Rev_CatchFA_P = [0.0408 0.9796 0.7000 0.3673 0.6531]; %Reversal catchFA
  14. for iLearning = 1:2
  15. %1 = Initial, 2 = Reversal
  16. switch iLearning
  17. case 1
  18. Hit = Hit_P;
  19. FA = FA_P;
  20. CatchFA = CatchFA_P;
  21. figure('Name', ['Initial_TaskPerfrmance'])
  22. set(gcf,'Position',[170 250 220 320])
  23. Position = 'southwest';
  24. FigTitle = 'Initial';
  25. case 2
  26. Hit = Rev_Hit_P;
  27. FA = Rev_FA_P;
  28. CatchFA = Rev_CatchFA_P;
  29. figure('Name', ['Reversal_TaskPerfrmance'])
  30. set(gcf,'Position',[170 250 220 320])
  31. Position = 'southeast';
  32. FigTitle = 'Reversal';
  33. end
  34. NofSession = size(Hit,2);
  35. plot(Hit', '-o', 'color',[0.25 0.85 0.25],'MarkerFaceColor',[0.25 0.85 0.25]);
  36. hold on;
  37. plot(FA', '-o', 'color','r','MarkerFaceColor','r');
  38. plot(CatchFA', '-o', 'color', [0.5 0.5 0.5],'MarkerFaceColor', [0.5 0.5 0.5]);
  39. title(FigTitle);
  40. xlim([0 NofSession+1]);
  41. ylim ([0 1.1]);
  42. NofXticks = 1:1:NofSession;
  43. xticks(NofXticks);
  44. yticks([0 1.0]);
  45. xlabel('Session')
  46. ylabel('Response ratio')
  47. box off
  48. %legend
  49. legend('Hit', 'FA', 'CatchFA', 'location', Position);
  50. legend box off
  51. end %for iLearning