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