Complex-step-compatible atan2()
Versión 1.0.0 (2,66 KB) por
Anthony Ricciardi
atan2() or arctan2() function that is compatible with complex-step derivative operations.
The function atan2(Y,X) [or arctan2(Y,X)] is the four quadrant arctangent of the elements of X and Y such that -pi <= atan2(Y,X) <= pi.
MATLAB atan2() reports an error when inputs are complex. This function reproduces MATLAB atan2() results for real inputs, but can be used with complex inputs to enable complex-step derivative operations.
There is an output discontinuity at T = pi and -pi. However, the output derivative is continuous, so, at T = pi and -pi, this function calculates the derivative analytically and adds complex-step-equivalent perturbations to the output.
Because the function remains discontinuous, the user should carefully consider before using atan2() output for gradient-based optimization.
Complex step is a numerical differentiation technique. See description:
Citar como
Anthony Ricciardi (2025). Complex-step-compatible atan2() (https://es.mathworks.com/matlabcentral/fileexchange/101193-complex-step-compatible-atan2), MATLAB Central File Exchange. Recuperado .
Compatibilidad con la versión de MATLAB
Se creó con
R2016b
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS LinuxEtiquetas
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Descubra Live Editor
Cree scripts con código, salida y texto formateado en un documento ejecutable.
| Versión | Publicado | Notas de la versión | |
|---|---|---|---|
| 1.0.0 |
