comparison toolboxes/MIRtoolbox1.3.2/MIRToolbox/mirgetrange.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 r = mirgetrange(x)
2
3 if isempty(x)
4 r = {};
5 return
6 end
7
8 if isstruct(x)
9 fields = fieldnames(x);
10 for f = 1:length(fields)
11 d.(fields{f}) = mirgetrange(x.(fields{f}));
12 end
13 return
14 end
15
16 if iscell(x)
17 x = x{1};
18 end
19 v = get(x,'Data');
20 if isa(x,'mirscalar')
21 m = get(x,'Mode');
22 end
23
24 if isa(x,'mirclassify')
25 d = get(x,'Data');
26 return
27 end
28
29 if isa(x,'miremotion')
30 return
31 end
32
33 if isa(x,'mirsimatrix')
34 return
35 end
36
37 pv = get(x,'PeakVal');
38 if not(isempty(pv)) && not(isempty(pv{1})) && not(isempty(pv{1}{1}))
39 d = uncell(pv);
40 else
41 d = uncell(v,isa(x,'mirscalar'));
42 end
43
44 if not(iscell(d))
45 d = {d};
46 end
47 r = [];
48 for i = 1:length(d)
49 r = [r;d{i}(:)];
50 end
51 r = sort(r);