⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sizefig.m

📁 这是一个很适合研究和学习用的电力系统仿真软件
💻 M
字号:
function pos = sizefig(dx,dy)
% FIGSIZE determine the figure size for the current screen resolution
%
% SIZES = SIZEFIG(DX,DY)
%     DX    = normalized width for a 1024x768 screen
%     DY    = normalized hight for a 1024x768 screen
%     POS = resulting figure normalized position [x y dx dy]
%
%Author:    Federico Milano
%Date:      22-Sep-2003
%Version:   1.0.0
%
%E-mail:    fmilano@thunderbox.uwaterloo.ca
%Web-site:  http://thunderbox.uwaterloo.ca/~fmilano
%
% Copyright (C) 2002-2006 Federico Milano

if ~strcmp(get(0,'Units'),'pixels')
  set(0,'Units','pixels')
end

% get screen size

scrnsize = get(0,'ScreenSize');
screenx = scrnsize(3);
screeny = scrnsize(4);
screenr = screeny/screenx;

% check screen ratio
% standard screen ratio 768/1024 = 0.75

if screenr > 0.75
  screeny = screenx*screenr;
elseif screenr < 0.75
  screenx = screeny/screenr;
end

% changes apply only if the screen resolution is higher than
% 1024x768

if screenx > 1024 | screeny > 768
  dx = 1024*dx/screenx;
  dy =  768*dy/screeny;
end

% output window position

pos = [(1-dx)*0.5, (1-dy)*0.5, dx, dy];

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -