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