MATLAB 帮助中心
本页采用了机器翻译。点击此处可查看英文原文。
将角度从度转换为
[A1,...,An] = fromDegrees(toUnits,D1,...,Dn)
[A1,...,An] = fromDegrees(toUnits,D1,...,Dn) 将 D1,...,Dn 指定的角度从度转换为 toUnits 指定的单位。当您在运行时才确定输出单位时,此函数可用于将角度从度转换为其他单位。
A1,...,An
toUnits
D1,...,Dn
示例
全部折叠
将几个值从度转换为弧度。
[A1,A2,A3,A4] = fromDegrees("radians",45,90,135,180)
A1 = 0.7854
A2 = 1.5708
A3 = 2.3562
A4 = 3.1416
通过指定一个数组,将相同的值从度转换为其他单位。
D = [45 90 135 180]; A = fromDegrees("radians",D)
A = 1×4 0.7854 1.5708 2.3562 3.1416
"degrees"
"radians"
输出单元,指定为 "degrees" 或 "radians"。您还可以指定缩写形式,例如 "deg" 和 "rad"。
"deg"
"rad"
数据类型: char | string
char
string
以度为单位的角,指定为一个或多个数值数组。
以度或弧度为单位的角,返回的数值数组个数与 D1,...,Dn 中相同。每个输出数组的大小与对应的输入数组的大小相匹配。
在 R2007b 中推出
fromRadians
deg2rad
toDegrees
toRadians
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处