deg2rad.m

来自「JLAB is a set of Matlab functions I have」· M 代码 · 共 31 行

M
31
字号
function[varargout]=deg2rad(varargin)%DEG2RAD  Converts degrees to radians.%%   [R1,R2,...RN]=DEG2RAD(D1,D2,...DN) converts the input angles from%   degrees to radians.  Output angles are in the range [-pi,pi].%%   See also RAD2DEG, DEG180, DEG360. % %   'deg2rad --t' runs a test.%   __________________________________________________________________%   This is part of JLAB --- type 'help jlab' for more information%   (C) 2006 J.M. Lilly --- type 'help jlab_license' for details if strcmp(varargin{1}, '--t')    deg2rad_test,returnendc=2*pi/360;varargout=varargin;for i=1:nargin;    varargout{i}=angle(rot(varargin{i}.*c));end function[]=deg2rad_testth  =[0 90   180 -90   0    360+90];th2= [0 pi/2 pi -pi/2 0 pi/2];reporttest('DEG2RAD simple',aresame(deg2rad(th),th2)) 

⌨️ 快捷键说明

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