Mercurial > hg > camir-aes2014
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/toolboxes/MIRtoolbox1.3.2/MIRToolbox/mirgetrange.m Tue Feb 10 15:05:51 2015 +0000 @@ -0,0 +1,51 @@ +function r = mirgetrange(x) + +if isempty(x) + r = {}; + return +end + +if isstruct(x) + fields = fieldnames(x); + for f = 1:length(fields) + d.(fields{f}) = mirgetrange(x.(fields{f})); + end + return +end + +if iscell(x) + x = x{1}; +end +v = get(x,'Data'); +if isa(x,'mirscalar') + m = get(x,'Mode'); +end + +if isa(x,'mirclassify') + d = get(x,'Data'); + return +end + +if isa(x,'miremotion') + return +end + +if isa(x,'mirsimatrix') + return +end + +pv = get(x,'PeakVal'); +if not(isempty(pv)) && not(isempty(pv{1})) && not(isempty(pv{1}{1})) + d = uncell(pv); +else + d = uncell(v,isa(x,'mirscalar')); +end + +if not(iscell(d)) + d = {d}; +end +r = []; +for i = 1:length(d) + r = [r;d{i}(:)]; +end +r = sort(r); \ No newline at end of file