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