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

📄 mmis2d.m

📁 《精通matlab7》“mastering matlab 7”的代码。
💻 M
字号:
function [tf,xa,ya]=mmis2d(H)
%MMIS2D True for Axes that are 2D. (MM)
% MMIS2D(H) returns True if the axes having handle H displays
% a 2D viewpoint of the X-Y plane where the X- and Y-axes are
% parallel to the sides of the associated figure window.
%
% [TF,Xa,Ya]=MMIS2D(H) in addition returns the angles of x- and y-axes 
% 
% e.g., if the x-axis increases from right-to-left Xa=180
% e.g., if the y-axis increases from left-to-right Ya=0
% e.g., if the x-axis increases from bottom-to-top Xa=90

% D.C. Hanselman, University of Maine, Orono, ME 04469
% 8/22/97
% Mastering MATLAB 5, Prentice Hall, ISBN 0-13-858366-8

if ~ishandle(H)
	error('H Must be a Handle.')
end
if ~strcmp(get(H,'Type'),'axes')
	error('H Must be a Handle to an Axes Object.')
end
v=get(H,'view');
az=v(1); el=v(2);
tf=rem(az,90)==0 & abs(el)==90;

if nargout==3
	xdir=strcmp(get(H,'Xdir'),'reverse');
	ydir=strcmp(get(H,'Ydir'),'reverse');
	s=sign(el);
	
	xa=mod(-s*az - xdir*180,360);
	ya=mod(s*(90-az) - ydir*180,360);
end
	

⌨️ 快捷键说明

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