annotate toolboxes/MIRtoolbox1.3.2/MIRToolbox/@mirdata/mirdisplay.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
rev   line source
wolffd@0 1 function mirdisplay(d,varargin)
wolffd@0 2 % MIRDATA/DISPLAY display of a MIR data
wolffd@0 3
wolffd@0 4 disp(' ');
wolffd@0 5 v = d.data;
wolffd@0 6 f = d.sr;
wolffd@0 7 n = d.name;
wolffd@0 8 l = d.label;
wolffd@0 9 p = d.pos;
wolffd@0 10 fp = d.framepos;
wolffd@0 11 pp = d.peak.pos;
wolffd@0 12 pm = d.peak.mode;
wolffd@0 13 ld = length(v);
wolffd@0 14 if isempty(d.attack)
wolffd@0 15 ap = cell(ld);
wolffd@0 16 else
wolffd@0 17 ap = d.attack.pos;
wolffd@0 18 end
wolffd@0 19 if isempty(d.release)
wolffd@0 20 rp = cell(ld);
wolffd@0 21 else
wolffd@0 22 rp = d.release.pos;
wolffd@0 23 end
wolffd@0 24 if isempty(d.track)
wolffd@0 25 tp = cell(ld);
wolffd@0 26 tv = cell(ld);
wolffd@0 27 else
wolffd@0 28 tp = d.track.pos;
wolffd@0 29 tv = d.track.val;
wolffd@0 30 end
wolffd@0 31 if ld == 0
wolffd@0 32 disp('No data.');
wolffd@0 33 else
wolffd@0 34 for i = 1:length(v)
wolffd@0 35 if nargin < 2
wolffd@0 36 va = inputname(1);
wolffd@0 37 else
wolffd@0 38 va = varargin{1};
wolffd@0 39 end
wolffd@0 40 if isempty(va)
wolffd@0 41 va = 'ans';
wolffd@0 42 end
wolffd@0 43 if length(v)>1
wolffd@0 44 va = [va,'(',num2str(i),')'];
wolffd@0 45 end
wolffd@0 46 if not(isempty(l)) && iscell(l) && not(isempty(l{i}))
wolffd@0 47 lab = ' with label ';
wolffd@0 48 if isnumeric(l{i})
wolffd@0 49 lab = [lab,num2str(l{i})];
wolffd@0 50 else
wolffd@0 51 lab = [lab,l{i}];
wolffd@0 52 end
wolffd@0 53 else
wolffd@0 54 lab = '';
wolffd@0 55 end
wolffd@0 56 disp([va,' is the ',d.title,' related to ',n{i},lab,...
wolffd@0 57 ', of sampling rate ',num2str(f{i}),' Hz.'])
wolffd@0 58 if size(v{i},2) == 0
wolffd@0 59 if isempty(d.init)
wolffd@0 60 disp('It does not contain any data.');
wolffd@0 61 else
wolffd@0 62 disp('It has not been loaded yet.');
wolffd@0 63 end
wolffd@0 64 else
wolffd@0 65 if iscell(d.channels)
wolffd@0 66 cha = d.channels{i};
wolffd@0 67 else
wolffd@0 68 cha = [];
wolffd@0 69 end
wolffd@0 70 flag = displot(p{i},v{i},d.abs,d.ord,d.title,fp{i},pp{i},tp{i},tv{i},...
wolffd@0 71 cha,d.multidata,pm{i},ap{i},rp{i},d.clusters{i});
wolffd@0 72 if flag
wolffd@0 73 fig = get(0,'CurrentFigure');
wolffd@0 74 disp(['Its content is displayed in Figure ',num2str(fig),'.']);
wolffd@0 75 else
wolffd@0 76 disp('It does not contain any data.');
wolffd@0 77 end
wolffd@0 78 end
wolffd@0 79 end
wolffd@0 80 end
wolffd@0 81 disp(' ');