sqrt 函数
Square root
平方根
Syntax
语法
B = sqrt(X)
Description
描述
B = sqrt(X) returns the square root of each element of the array X. For the elements of X that are negative or complex, sqrt(X) produces complex results.
B=sqrt(X)返回阵列X每个元素的平方根。X的元素是负数或复数,sqrt(X)产生复数结果。
Remarks
备注
See sqrtm for the matrix square root.
查阅sqrtm作为矩阵的平方根运算。
Examples
例如:
sqrt((-2:2)')
ans =
0 + 1.4142i
0 + 1.0000i
0
1.0000
1.4142