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

📄 mmn2px.m

📁 精通Matlab综合辅导与指南 用于数学建模的教科书
💻 M
字号:
function y=mmn2px(x,Hf)%MMN2PX Normalized to Pixel Coordinate Transformation.% MMN2PX(X) converts the position vector X from% normalized coordinates to pixel coordinates w.r.t.% the computer screen.%% MMN2PX(X,H) converts the position vector X from% normalized coordinates to pixel coordinates w.r.t.% the figure window having handle H.%% X=[left bottom width height] or X=[width height]% D.C. Hanselman, University of Maine, Orono, ME 04469% 4/10/95% Copyright (c) 1996 by Prentice-Hall, Inc. lx=length(x);sz='Position';if nargin==1,Hf=0;sz='ScreenSize';endif any(x>1)|any(x<0)|(lx~=4&lx~=2)	error('Input is not a normalized position vector.')endif lx==2,x=[0 0 x(:)'];end  % [width height] input formatu=get(Hf,'Units');set(Hf,'Units','pixels');s=get(Hf,sz);y=x.*([s(3:4) s(3:4)]-1)+1;set(Hf,'Units',u);if lx==2,y=y(3:4);end  % [width height] output format

⌨️ 快捷键说明

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