wpposaxe.m
上传用户:haiyisale
上传日期:2013-01-09
资源大小:3246k
文件大小:3k
源码类别:

波变换

开发平台:

Matlab

  1. function [out1,out2,out3,out4,out5,out6,out7] = wpposaxe(win,dim,pos_g,is)
  2. %WPPOSAXE Axes positions for wavelet packets tool.
  3. %   [OUT1,OUT2,OUT3,OUT4,OUT5,OUT6,OUT7] = WPPOSAXE(WIN,DIM,POS_G,IS)
  4. %   M. Misiti, Y. Misiti, G. Oppenheim, J.M. Poggi 12-Mar-96.
  5. %   Last Revision: 01-May-1998.
  6. %   Copyright 1995-2002 The MathWorks, Inc.
  7. % $Revision: 1.10 $
  8. % out1 = pos_axe_pack
  9. % out2 = pos_axe_tree
  10. % out3 = pos_axe_cfs
  11. % out4 = pos_axe_sig
  12. % out5 = pos_sli_size
  13. % out6 = pos_sli_pos
  14. % out7 = pos_axe_col
  15. [bdx,bdy]     = depOfMachine;
  16. [xpixl,ypixl] = wfigutil('prop_size',win,1,1);
  17. bdx           = bdx*xpixl;
  18. bdy           = bdy*ypixl;
  19. w_axe         = (pos_g(3)-4*bdx)/2;
  20. % Get Globals.
  21. %-------------
  22. % [Def_Btn_Height,sliYProp] = mextglob('get','Def_Btn_Height','Sli_YProp');
  23. % h_sli = sliYProp*Def_Btn_Height*ypixl;
  24. h_sli     = 14*ypixl;
  25. h_axe_col = bdy/2;
  26. w_axe_col = w_axe;
  27. if dim==1
  28.     h_axe       = pos_g(4)-6*bdy;
  29.     w_axe_tree  = w_axe;
  30.     h_axe_tree  = (2*h_axe)/3;
  31.     w_axe_pack  = w_axe;
  32.     h_axe_pack  = h_axe/3;
  33.     w_axe_sig   = w_axe;
  34.     h_axe_sig   = h_axe/3;
  35.     w_axe_cfs   = w_axe;
  36.     h_axe_cfs   = (2*h_axe)/3-bdy-h_axe_col-2*bdy;
  37.     c1x = pos_g(1)+bdx+w_axe_pack/2;
  38.     c1y = pos_g(2)+2*bdy+h_axe_pack/2;
  39.     c2x = c1x;
  40.     c2y = c1y+(h_axe_pack+h_axe_tree)/2+2*bdy;
  41.     c5x = c1x+w_axe+2*bdx;
  42.     c5y = pos_g(2)+2*bdy+h_axe_col/2;
  43.     c3x = c1x+w_axe+2*bdx;
  44.     c3y = c5y+(h_axe_col+h_axe_cfs)/2+bdy+bdy;
  45.     c4x = c3x;
  46.     c4y = c3y+(h_axe_cfs+h_axe_sig)/2+3*bdy;
  47. elseif dim==2
  48.     h_axe = (pos_g(4)-6*bdy-h_axe_col-3*bdy)/2;
  49.     c5x   = pos_g(1)+pos_g(3)/2;
  50.     c5y   = pos_g(2)+2*bdy+h_axe_col/2;
  51.     c1x   = pos_g(1)+bdx+w_axe/2;
  52.     c1y   = c5y+(h_axe+h_axe_col)/2+2*bdy;
  53.     c2x   = c1x;
  54.     c2y   = c1y+h_axe+3*bdy;
  55.     c3x   = c1x+w_axe+2*bdx;
  56.     c3y   = c1y;
  57.     c4x   = c3x;
  58.     c4y   = c2y;
  59.     w_axe_tree = w_axe;
  60.     h_axe_tree = h_axe;
  61.     if nargin==4
  62.         [w_axe,h_axe] = wpropimg(is,w_axe,h_axe);
  63.     end
  64.     w_axe_pack = w_axe;
  65.     h_axe_pack = h_axe;
  66.     w_axe_sig  = w_axe;
  67.     h_axe_sig  = h_axe;
  68.     w_axe_cfs  = w_axe;
  69.     h_axe_cfs  = h_axe;
  70. end
  71. out1 = [ c1x-w_axe_pack/2, ...
  72.          c1y-h_axe_pack/2, ...
  73.          w_axe_pack,       ...
  74.          h_axe_pack      ];
  75. out2 = [ c2x-w_axe_tree/2, ...
  76.          c2y-h_axe_tree/2, ...
  77.          w_axe_tree,       ...
  78.          h_axe_tree      ];
  79. out3 = [ c3x-w_axe_cfs/2,  ...
  80.          c3y-h_axe_cfs/2,  ...
  81.          w_axe_cfs,        ...
  82.          h_axe_cfs       ];
  83. out4 = [ c4x-w_axe_sig/2,  ...
  84.          c4y-h_axe_sig/2,  ...
  85.          w_axe_sig,        ...
  86.          h_axe_sig       ];
  87. d_yh = 0.75*h_sli;
  88. d_yl = 0.50*h_sli;
  89. out5 = [ out2(1)+out2(3)/4,     ...
  90.          out2(2)+out2(4)-d_yh,  ...
  91.          out2(3)/2              ...
  92.          h_sli   ];
  93. out6 = [ out2(1)+out2(3)/8,...
  94.          out2(2)-d_yl,     ...
  95.          (3*out2(3))/4,    ...
  96.          h_sli   ];
  97. out7 = [ c5x-w_axe_col/2,  ...
  98.          c5y-h_axe_col/2,  ...
  99.          w_axe_col,        ...
  100.          h_axe_col       ];
  101. %-------------------------------------------------
  102. function varargout = depOfMachine(varargin)
  103. scrSize = get(0,'ScreenSize');
  104. if scrSize(4)<=600
  105.     bdx = 20; bdy = 15;
  106. else
  107.     bdx = 30; bdy = 20;
  108. end
  109. varargout = {bdx,bdy};
  110. %-------------------------------------------------