comparison toolboxes/MIRtoolbox1.3.2/MIRToolbox/@mirkeysom/display.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 function mov = display(k,filename)
2 % KEYSOM/DISPLAY display of key som
3
4 mov = [];
5 load keysomaudiodata;
6 w = get(k,'Weight');
7 n = get(k,'Name');
8 if nargin>1
9 mov = avifile(filename);
10 %elseif and(nargout>0,size(w)>0)
11 % mov = moviein(size(w{1}{1},2)); %no longer needed as of MATLAB Release 11 (5.3).
12 end
13 for i = 1:length(w)
14 wi = w{i};
15 fig = figure;
16 for j = 1:length(wi)
17 wj = wi{j};
18 for k = 1:size(wj,2)
19 for l = 1:size(wj,3)
20 h = pcolor(squeeze(wj(:,k,l,:)));
21 shading interp
22 axis([1,36,1,24]), view(2) , caxis([-1 1])
23 axis off;
24 hold on
25 for m=1:24
26 text(0.99*keyx(m)-1, 0.98*keyy(m)+1, keyN(m,:),...
27 'FontSize',16,'FontName','Arial');
28 end
29 hold off
30 set(gca,'PlotBoxAspectRatio',[1.5 1 1])
31 colormap('jet')
32 title('Self-organizing map projection of chromagram')
33 drawnow
34 if nargin>1
35 mov = addframe(mov,gca);
36 elseif nargout>0
37 colormap('jet')
38 if k == 1
39 mov = getframe;
40 else
41 mov(k) = getframe;
42 end
43 end
44 end
45 end
46 end
47 disp(['The key som related to file ',n{i},...
48 ' is displayed in Figure ',num2str(fig),'.']);
49 end
50 if nargin>1
51 mov = close(mov);
52 disp(['Data exported to file ',filename,'.']);
53 end
54 disp(' ');