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