Square root of the entries of x using the CORDIC algorithm
Version 1.0.0 (1.94 KB) by
Marco Cococcioni
This is a vectorized implementation in native Matlab code of the CORDIC algorithm for the square root.
This function computes the square root of each entry of the real-valued vector x,
using the CORDIC algorithm. It performs a number of iterations equal to n
(at each iteration, the binary accuracy rougly increases by one).
This is a vectorized implementation, in native Matlab code,
able to compute the square roots for all the entries of the
vector x.
Differently from Matlab sqrt, it returns NaN for negative entries
instead of the positive complex square root.
Please also notice that Matlab cordicsqrt will return zeros for
negative entries of x.
Possible improvement: use bit shift operations to generate the required powers of two.
Cite As
Marco Cococcioni (2024). Square root of the entries of x using the CORDIC algorithm (https://www.mathworks.com/matlabcentral/fileexchange/95403-square-root-of-the-entries-of-x-using-the-cordic-algorithm), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2021a
Compatible with R2016a and later releases
Platform Compatibility
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0 |