Fig1I.m 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. %% Fig. 1I - Example cell traces
  2. clear
  3. close all
  4. % ===========================================
  5. %% Plot calcium traces of three example cells
  6. % ===========================================
  7. %prepare variables
  8. load('Fig1i.mat');
  9. TimeWinFrame = [-15:1:120];% -0.5 s to 4.0 s
  10. fs = 30;
  11. for iTrialType = 1:3 %1: Go, 2: Nogo, 3: Catch
  12. meanResp = [];
  13. SEM = [];
  14. switch iTrialType
  15. case 1 %Go trial
  16. fig1 = figure; %Go trial
  17. fig1.Position = [50 50 150 300];
  18. meanResp = meanCalciumGo;
  19. SEM = ErrCalciumGo;
  20. Color = 'r';
  21. suptitle('Go');
  22. case 2 %Nogo trial
  23. fig2 = figure; %Nogo trial
  24. fig2.Position = [200 200 150 300];
  25. meanResp = meanCalciumNogo;
  26. SEM = ErrCalciumNogo;
  27. Color = 'g';
  28. suptitle('Nogo');
  29. case 3 %Catch trial
  30. fig3 = figure; %Catch trial
  31. fig3.Position = [350 350 150 300];
  32. meanResp = meanCalciumCatch;
  33. SEM = ErrCalciumCatch;
  34. Color = 'c';
  35. suptitle('Catch');
  36. end%switch iTrialType
  37. for iCell = 1:3 % Three example cells
  38. subplot(3, 1, iCell);
  39. shadedErrorBar(TimeWinFrame/fs, meanResp(iCell, :), SEM(iCell, :), 'lineprops', Color);
  40. hold on;
  41. box off
  42. xlim([-0.5 4.0]);
  43. ylim([-1 2]);
  44. vline([0 2 4]);
  45. hline(0, 'k');
  46. end%for iCell
  47. end%for iTrialType