MATLAB 帮助中心
fi 对象的平方根
fi
c = sqrt(a)
c = sqrt(a,T)
c = sqrt(a,F)
c = sqrt(a,T,F)
此函数使用对分算法计算 fi 对象的平方根。
c = sqrt(a) 返回 fi 对象 a 的平方根。使用与 a 相关联的 fimath 来计算中间量。c 的 numerictype 对象是使用内部规则自动确定的。
c
a
fimath
numerictype
c = sqrt(a,T) 使用 numerictype 对象 T 返回 fi 对象 a 的平方根。使用与 a 相关联的 fimath 来计算中间量。请参阅数据类型传播规则。
T
c = sqrt(a,F) 返回 fi 对象 a 的平方根。使用 fimath 对象 F 计算中间量。c 的 numerictype 对象是使用内部规则自动确定的。
F
当 a 是内置的 double 或 single 数据类型时,此语法等效于 c = sqrt(a),并且忽略 fimath 对象 F。
double
single
c = sqrt(a,T,F) 使用 numerictype 对象 T 返回 fi 对象 a 的平方根。中间量也使用 fimath 对象 F 来计算。请参阅数据类型传播规则。
全部折叠
输入 fi 数组,指定为标量、向量、矩阵或多维数组。
sqrt 不支持复杂、负值或 [斜率偏置] 输入。
sqrt
示例: a = fi(pi,1,8,3)
a = fi(pi,1,8,3)
数据类型: fi
输出 c 的 numerictype,指定为 numerictype 对象。
示例: T = numerictype(1,32,30)
T = numerictype(1,32,30)
fimath 用于计算中间量,指定为 fimath 对象。
示例: F = fimath('OverflowAction','Saturate','RoundingMethod','Convergent')
F = fimath('OverflowAction','Saturate','RoundingMethod','Convergent')
对于未将输出的 numerictype 对象指定为 sqrt 函数的输入的语法,它将根据以下内部规则自动计算:
signc=signa
WLc=ceil(WLa2)
FLc=WLc−ceil(WLa−FLa2)
对于您指定 numerictype 对象 T 的语法,sqrt 函数遵循下表中列出的数据类型传播规则。一般情况下,这些规则可以概括为“传播浮点数据类型”。这样,您可以编写同时适用于定点和浮点输入的代码。
内置 double
任一值
内置 single
fi Fixed
Fixed
numerictype 对象 T 的数据类型
fi ScaledDouble
ScaledDouble
具有 T 对象 numerictype 的属性的 ScaledDouble
fi double
fi single
任何 fi 数据类型
全部展开
使用说明和限制:
不支持复数输入。
不支持斜率偏置定标输入。
对于生成的 C 代码,负输入产生 0 结果。
MATLAB® 可执行 (MEX) 代码生成不支持负输入。
在 R2006b 中推出
fi | fimath | numerictype
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 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处