Mercurial > hg > camir-aes2014
comparison toolboxes/MIRtoolbox1.3.2/MIRToolbox/@mirhisto/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 display(s) | |
2 % SCALAR/DISPLAY display the values of an histogram | |
3 disp(' '); | |
4 d = get(s,'Data'); | |
5 b = get(s,'Bins'); | |
6 t = ['Histogram of ',get(s,'Title')]; | |
7 n = get(s,'Name'); | |
8 l = get(s,'MultiData'); | |
9 u = get(s,'Unit'); | |
10 if not(isempty(u)) && not(strcmp(u,'.')) | |
11 u = [' (in ',u,')']; | |
12 end | |
13 pp = get(s,'PeakPos'); | |
14 for i = 1:length(d) | |
15 figure | |
16 set(gca,'NextPlot','replacechildren',... | |
17 'LineStyleOrder',{'-',':','--',':','-.'}) | |
18 nl = size(b{i},1); | |
19 for j = 1:nl | |
20 bar((b{i}(j,:,1)+b{i}(j,:,2))/2,d{i}(j,:)); | |
21 hold all | |
22 end | |
23 if not(isempty(pp{i}{1})) | |
24 for j = 1:nl; | |
25 ppj = pp{i}{1}{1,j,1}; | |
26 bar((b{i}(j,ppj,1)+b{i}(j,ppj,2))/2,d{i}(j,ppj),'or') | |
27 end | |
28 end | |
29 xlabel(['values',u]); | |
30 ylabel('number of occurrences') | |
31 title(t) | |
32 nl = size(d{i},1); | |
33 if nl>1 | |
34 legend(l,'Location','Best') | |
35 end | |
36 fig = get(0,'CurrentFigure'); | |
37 va = inputname(1); | |
38 if isempty(va) | |
39 va = 'ans'; | |
40 end | |
41 disp([va,' is the ',t,' related to file ',n{i},... | |
42 ' is displayed in Figure ',num2str(fig),'.']); | |
43 end | |
44 disp(' '); |