Daniel@0: function display(s) Daniel@0: % SCALAR/DISPLAY display the values of an histogram Daniel@0: disp(' '); Daniel@0: d = get(s,'Data'); Daniel@0: b = get(s,'Bins'); Daniel@0: t = ['Histogram of ',get(s,'Title')]; Daniel@0: n = get(s,'Name'); Daniel@0: l = get(s,'MultiData'); Daniel@0: u = get(s,'Unit'); Daniel@0: if not(isempty(u)) && not(strcmp(u,'.')) Daniel@0: u = [' (in ',u,')']; Daniel@0: end Daniel@0: pp = get(s,'PeakPos'); Daniel@0: for i = 1:length(d) Daniel@0: figure Daniel@0: set(gca,'NextPlot','replacechildren',... Daniel@0: 'LineStyleOrder',{'-',':','--',':','-.'}) Daniel@0: nl = size(b{i},1); Daniel@0: for j = 1:nl Daniel@0: bar((b{i}(j,:,1)+b{i}(j,:,2))/2,d{i}(j,:)); Daniel@0: hold all Daniel@0: end Daniel@0: if not(isempty(pp{i}{1})) Daniel@0: for j = 1:nl; Daniel@0: ppj = pp{i}{1}{1,j,1}; Daniel@0: bar((b{i}(j,ppj,1)+b{i}(j,ppj,2))/2,d{i}(j,ppj),'or') Daniel@0: end Daniel@0: end Daniel@0: xlabel(['values',u]); Daniel@0: ylabel('number of occurrences') Daniel@0: title(t) Daniel@0: nl = size(d{i},1); Daniel@0: if nl>1 Daniel@0: legend(l,'Location','Best') Daniel@0: end Daniel@0: fig = get(0,'CurrentFigure'); Daniel@0: va = inputname(1); Daniel@0: if isempty(va) Daniel@0: va = 'ans'; Daniel@0: end Daniel@0: disp([va,' is the ',t,' related to file ',n{i},... Daniel@0: ' is displayed in Figure ',num2str(fig),'.']); Daniel@0: end Daniel@0: disp(' ');