www.gusucode.com > 声音的处理有:LPC,FFT,共振峰,频谱源码程序 > siganlandsystemusingMatlab/SSUM/library/setdefaults.m
function setdefaults(varargin) % Figure defaults if nargin < 1 action = 'default'; else action = varargin{1}; end % Get screen size in Characters set(0,'Units','Characters'); Pix_SS = get(0,'ScreenSize'); set(gcf,'units','Characters'); oldP = get(gcf,'Position'); % Check if figure goes outside of screen if oldP(3) > Pix_SS(3) oldP(3) = Pix_SS(3); end if oldP(4) > Pix_SS(4) oldP(4) = Pix_SS(4); end % Now place figure so that it displays correctly switch action case 'menu' switch computer case {'GLNX86','MAC'} set(gcf,'Position',[floor(Pix_SS(3)*0.01) floor(Pix_SS(4)*0.5) oldP(3) oldP(4)]); case 'PCWIN' %set(gcf,'Position',[100 300 oldP(3) oldP(4)]); end case 'default' switch computer case {'GLNX86','MAC'} set(gcf,'Position',[1 3 oldP(3) oldP(4)]); case 'PCWIN' set(gcf,'Position',[0 0 oldP(3) oldP(4)]); end end % Supress log(zero) warnings. % warning('off','MATLAB:LogofZero'); % Doesn't seem to work on Linux %warning off all