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