|
704 | 704 | end |
705 | 705 |
|
706 | 706 | if(isa(mat,'integer') || isinteger(mat) || (isfloat(mat) && all(mod(mat(:),1) == 0))) |
707 | | - if(~any(mat<0)) |
708 | | - id=find(find(max(double(mat(:)))>=[-eps 2^8 2^16 2^32 2^64]),1,'last'); |
709 | | - key=Imarker(1:2:end); |
710 | | - type=key(id); |
711 | | - else |
712 | | - id=find(find(-min(double(mat(:)))>[0 2^7 2^15 2^31 2^63]),1,'last'); |
713 | | - id=[id,find(find(max(double(mat(:)))>[-eps 2^7 2^15 2^31 2^63]),1,'last')]; |
714 | | - key=Imarker(2:2:end); |
715 | | - type=key(min(id)); |
716 | | - end |
717 | 707 | if(~isvector(mat) && isnest==1) |
718 | 708 | txt=cell2ubjson('',num2cell(mat,1),level,varargin{:}); |
719 | 709 | elseif(~ismsgpack || size(mat,1)==1) |
| 710 | + if(~any(mat<0)) |
| 711 | + cid=varargin{1}.IType_; |
| 712 | + type=Imarker(end); |
| 713 | + maxdata=max(double(mat(:))); |
| 714 | + for i=1:length(cid) |
| 715 | + if(maxdata==cast(maxdata,cid{i})) |
| 716 | + type=Imarker(i); |
| 717 | + break; |
| 718 | + end |
| 719 | + end |
| 720 | + else |
| 721 | + cid=varargin{1}.IType_; |
| 722 | + type=Imarker(end); |
| 723 | + mindata=min(double(mat(:))); |
| 724 | + maxdata=max(double(mat(:))); |
| 725 | + for i=1:length(cid) |
| 726 | + if(maxdata==cast(maxdata,cid{i}) && mindata==cast(mindata,cid{i})) |
| 727 | + type=Imarker(i); |
| 728 | + break; |
| 729 | + end |
| 730 | + end |
| 731 | + end |
720 | 732 | txt=I_a(mat(:),type,size(mat),varargin{:}); |
721 | 733 | else |
722 | 734 | txt=cell2ubjson('',num2cell(mat,2),level,varargin{:}); |
|
0 commit comments