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