%% Fig. 2A-B_LinePlot clear all close all % ========================================================================== %% k-mean cluster lineplot % ========================================================================== %Prepare variables load('Fig2AB_LinePlot.mat'); TimeWinFrame = [-15:1:120];% -0.5 s to 4.0 s fs = 30; %Learning phase initial = 1; reversal = 2; %Learning stage naive = 1; expert = 2; for iLearning = 1:2 %1 = Initial, 2 = Reversal disp(['iLearning = ', num2str(iLearning)]); switch iLearning case 1 f1 = figure('Name', 'Go-kmean cluster-Initial'); f1.Position = [190 198 560 420]; Mean = LineMean_Initial; SEM = LineSEM_Initial; case 2 f2 = figure('Name', 'Go-kmean cluster-Reversal'); f2.Position = [200 250 560 420]; Mean = LineMean_Reversal; SEM = LineSEM_Reversal; end for iCluster = 1:6 %NofCluter is 6 disp(['iCluster = ', num2str(iCluster)]); subplot(2, 3, iCluster); %Naive----------------------------------------------------------- shadedErrorBar2(TimeWinFrame/fs, Mean(iCluster, :, 1), SEM(iCluster, :, 1), {'-','color', [0 0 1]}); box off hold on; %Expert------------------------------------------------------------ shadedErrorBar2(TimeWinFrame/fs, Mean(iCluster, :, 2), SEM(iCluster, :, 2), {'-','color', [1 0 0]}); hline(0, 'k'); % Adjust lims xlim([-0.5 4.0]); ylim([-1.0 1.0]); %title switch iCluster case 1 title('Stable1') case 2 title('Stable2') case 3 title('Up') case 4 title('Down') case 5 title('Ramp-up') case 6 title('Ramp-down') end end %iCluster end %iLearning