Daniel@0: function r = mirgetrange(x) Daniel@0: Daniel@0: if isempty(x) Daniel@0: r = {}; Daniel@0: return Daniel@0: end Daniel@0: Daniel@0: if isstruct(x) Daniel@0: fields = fieldnames(x); Daniel@0: for f = 1:length(fields) Daniel@0: d.(fields{f}) = mirgetrange(x.(fields{f})); Daniel@0: end Daniel@0: return Daniel@0: end Daniel@0: Daniel@0: if iscell(x) Daniel@0: x = x{1}; Daniel@0: end Daniel@0: v = get(x,'Data'); Daniel@0: if isa(x,'mirscalar') Daniel@0: m = get(x,'Mode'); Daniel@0: end Daniel@0: Daniel@0: if isa(x,'mirclassify') Daniel@0: d = get(x,'Data'); Daniel@0: return Daniel@0: end Daniel@0: Daniel@0: if isa(x,'miremotion') Daniel@0: return Daniel@0: end Daniel@0: Daniel@0: if isa(x,'mirsimatrix') Daniel@0: return Daniel@0: end Daniel@0: Daniel@0: pv = get(x,'PeakVal'); Daniel@0: if not(isempty(pv)) && not(isempty(pv{1})) && not(isempty(pv{1}{1})) Daniel@0: d = uncell(pv); Daniel@0: else Daniel@0: d = uncell(v,isa(x,'mirscalar')); Daniel@0: end Daniel@0: Daniel@0: if not(iscell(d)) Daniel@0: d = {d}; Daniel@0: end Daniel@0: r = []; Daniel@0: for i = 1:length(d) Daniel@0: r = [r;d{i}(:)]; Daniel@0: end Daniel@0: r = sort(r);