function lrnProtocol_updated(flyTracks) flyTracks = flyTracks(1); figure; mch = []; oct = []; for i = 1:length(flyTracks.stimulus) MCH = strcmp(flyTracks.stimulus{4,i},'MCH'); OCT = strcmp(flyTracks.stimulus{4,i},'OCT'); if i ==1 tLabel = length(flyTracks.stimulus{2,i})-6; end if sum(MCH >= 1) mch = [mch,flyTracks.stimulus{2,i}]; end if sum(OCT >= 1) oct = [oct,flyTracks.stimulus{2,i}]; end end shock = ceil(flyTracks.realTime(logical(flyTracks.shock(:,1)))); shock = shock(1:8:end); shock = [shock,shock+1,shock+2,shock+3]; x = 1:ceil(flyTracks.realTime(end)); pOct = zeros(1,ceil(flyTracks.realTime(end))); pMch = zeros(1,ceil(flyTracks.realTime(end))); pShk = zeros(1,ceil(flyTracks.realTime(end))); pOct(oct) = 1; pMch(mch) = 1; pShk(shock) = 1; a = plot(x,pOct); a.Color = [0.2 0.5 0.2]; a.LineWidth = 1; hold on a = plot(x,pMch+1.5); a.Color = [0.4 0.2 0.5]; a.LineWidth = 1; a = plot(x,pShk+3); a.Color = [0.4 0.2 0.2]; a.LineWidth = 1; set(gca,'color','white') set(gcf,'color','white') %mattformat grid off set(gca,'XColor','white','YColor','white') %yticklabels({''}) a = text(-150,.5,'Oct','FontSize',35); a.Color = [0.2 0.5 0.2 0.3]; % a.FontWeight = 'bold'; a = text(-150,2,'Mch','FontSize',35); a.Color = [0.4 0.2 0.5 0.3]; % a.FontWeight = 'bold'; a= text(-150,3.5,'US','FontSize',35); a.Color = [0.9 0.5 0.5 0.3]; % a.FontWeight = 'bold'; a = find(pMch); a = a(1); xL = a(1)+(tLabel/2); tLabel = strcat(num2str(tLabel),'-secs'); a= text(xL,1.35,tLabel,'FontSize',15); a.HorizontalAlignment = 'center'; a.Color = [0 0 0]; a = find(pMch); a = a(1); set(gcf,'Renderer','Painters') %xticks(a(1):66:length(pMch)) %grid on