cfigure.m

来自「OFDM宽带无线系统的链路级的仿真程序(多天线」· M 代码 · 共 44 行

M
44
字号
% create a figure, with fixed size
% use it similar as figure function

function h=cfigure(k,width,height)
if nargin ==0,
    k = 1;
end
if nargin<=1,
    width = 16.2;
    height = 12.2;
end
%cfigure2(16.2,12.2);
% Customized figure function. Opens a figure with 
% specified width and height (in centimeters) centered
% on the screen.
% The properties are set such that Matlab won't resize the 
% figure while printing or exporting to graphics files (eps, 
% tiff, jpeg, ...).
%

% Get the screen size in centimeters
set(0,'units','centimeters')
scrsz=get(0,'screensize');
% Calculate the position of the figure
position=[scrsz(3)/2-width/2 scrsz(4)/2-height/2 width height];
h=figure(k);
set(h,'units','centimeters')
% Place the figure
set(h,'position',position)
% Do not allow Matlab to resize the figure while printing
set(h,'paperpositionmode','auto')
% Set screen and pigure units back to pixels
set(0,'units','pixel')
set(h,'units','pixel')

%
% Note: in order to avoid Matlab recalculating the axes ticks
% you will need to set the following commands in you program:
%
% set(gca,'xtickmode','manual')
% set(gca,'ytickmode','manual')
% set(gca,'ztickmode','manual') % IF you have a third axis
%

⌨️ 快捷键说明

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