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

📄 axesn.m

📁 很多matlab的源代码
💻 M
字号:
function axesn(l,x,y,lin,clr)
% AXESN Draws axes with arrowtips.
%
%       AXESN(L,X,Y,LIN,CLR) draws axes thru L = [X0 Y0] with arrowtips. 
%       [Default: L = (0,0) or bottom left corner of plot]
%	X and Y represent length of axes [Default: full plot length]
%	LIN is the linetype [Default: '-']
%	CLR is the colortype [Default: 'c']
%
%       If X = [XL XH], y = [YL YH], AXESN draws axes over given intervals
%
%       WARNING: Use AXESN as the last plotting command because AXESN leaves 
%       screen in HOLD OFF state!!!


% ADSP Toolbox: Version 2.0 
% For use with "Analog and Digital Signal Processing", 2nd Ed.
% Published by PWS Publishing Co.
%
% Ashok Ambardar, EE Dept. MTU, Houghton, MI 49931, USA
% http://www.ee.mtu/faculty/akambard.html
% e-mail: akambard@mtu.edu
% Copyright (c) 1998


s=axis;axis(s);
if nargin<5,clr='c';end
if nargin<4,lin='-';end
v=3;if exist('version')==5,vr=version;v=eval(vr(1));end
if v<5,ty=[lin,clr];else,ty=[clr,lin];end

if nargin==0,l=[s(1) s(3)];x=[s(1) s(2)];y=[s(3) s(4)];end
x0=l(1);y0=l(2);
if nargin==0,
if s(1)<0 & s(2)>=0,x0=0;end,
if s(3)<0 & s(4)>=0,y0=0;end,
end
if length(x)==1,x=[x0 x0+x];end,
if length(y)==1,y=[y0 y0+y];end
x(2)=min(x(2),s(2));y(2)=min(y(2),s(4));
hold on,plot(x,[y0 y0],ty,[x0 x0],y,ty)
if s(2)>x0 & s(4)>y0,axis(s);end
xx=.01*abs(s(2)-s(1));yy=.032*abs(s(4)-s(3));
if v>3,pp='position';ss=eval('get(gca,pp)');
xx=xx*0.5/ss(3);yy=yy*0.5/ss(4);end
if x(2)>x(1),t0=x(2);t2=[t0-2*xx t0 t0-2*xx t0-2*xx];y2=y0+.5*[yy 0 -yy yy];
if v>3,eval('fill(t2,y2,clr)'),end
plot(t2,y2,ty),end
if y(2)>0,y0=y(2);t0=x0;t1=[t0-xx t0 t0+xx t0-xx];y1=[y0-yy y0 y0-yy y0-yy];
if v>3,eval('fill(t1,y1,clr)');end,plot(t1,y1,ty);end,hold off

⌨️ 快捷键说明

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