📄 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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -