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