Attachment 'tkcca_example.m'
Download 1 fprintf('Loading Data\n')
2 load tkcca_toy_data
3
4 fprintf('Computing tkCCA\n')
5 [c,U,V] = tkcca_simple(x,y,lag,kappas);
6
7 fprintf('Plotting Results\n')
8 % plot results
9 figure(42),clf
10 subplot(2,3,1:3)
11 x_ = filter2(U,x,'valid');
12 y_=V'*y;
13 t=1:400;
14 plot(t(11:end-10),x_,'k-o',t,y_,'r-v')
15 xlim([270 310])
16 xlabel('Time [samples]','fontsize',6)
17 legend({'Canonical Component 1', 'Canonical Component 2'},'Location','SouthWest')
18 set(gca,'fontsize',6)
19
20 subplot(2,3,4),
21 imagesc(U),colorbar,
22 ylabel('Channel','fontsize',6)
23 xlabel('\tau','fontsize',6)
24 set(gca,'xtick',1:5:(2*lag)+1,'xticklabel',-lag:5:lag,'fontsize',6)
25 title('Variate of X')
26 subplot(2,3,5),
27 imagesc(V),colorbar
28 set(gca,'xtick',[],'fontsize',6)
29 ylabel('Channel','fontsize',6)
30 title('Variate of Y','fontsize',6)
31
32
33 subplot(2,3,6),
34 plot(-lag:lag,c,'r')
35 xlabel('\tau','fontsize',6)
36 title('canonical correlogram','fontsize',6)
37 set(gca,'fontsize',6)
38
39 set(gcf,'paperunits','centimeters','papersize',[14 7],'paperposition',[0 0 14 7])
40 print('tkcca_example.pdf','-dpdf')
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.