figurex.m

来自「approximate reinforcement learning」· M 代码 · 共 38 行

M
38
字号
function figh = figurex(cfg)% Figure creation with extended functionality%   FIGH = FIGUREX(CFG)% Create figure with extended options%% Parameters:%   CFG     - the configuration, or just a figure size% Returns:%   FIGH    - handle of created figureCFG.size = [];CFG.h = [];CFG.name = '';CFG.position = 'center';if ischar(cfg), cfg = str2cfg(cfg, fieldnames(CFG));elseif isnumeric(cfg), cfg = struct('size', cfg); end;cfg = checkparams(cfg, CFG);fargs = {};if cfg.size, fargs = {fargs{:}, 'Position', [0 0 cfg.size]};end;if cfg.name, fargs = {fargs{:}, 'Name', cfg.name};end;if cfg.h,    figh = figure(cfg.h, fargs{:});else    figh = figure(fargs{:});end;if cfg.position,    movegui(figh, cfg.position);end;% END figurex() RETURNING figh ===============================================

⌨️ 快捷键说明

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