Home >Common Problem >What is matlab root function?
#What is the root function in matlab?
matlab root function is the sqrt function.
Draw the root sign on MATLAB
1. Define the number or matrix that needs to be rooted as x;
2. Let B=sqrt(x);
3. When x has more than one root, select the required number or matrix in B.
Extended information:
B = sqrt(X) returns the square root of each element of array X. For negative or complex elements of X, sqrt(X) produces a complex result.
The domain of the sqrt function includes negative numbers and complex numbers. For negative complex numbers z = u i*w, the square root of the complex number sqrt(z) returns sqrt(r)*(cos(phi/2) 1i*sin(phi /2)), where r = abs(z) is the radius and phi = angle(z) is the phase angle in the closed interval -pi
If you want negative and complex numbers to return an error message instead of returning a complex result, use realsqrt instead.
The above is the detailed content of What is matlab root function?. For more information, please follow other related articles on the PHP Chinese website!