MATLAB: How to compute the four-quadrant inverse tangent using symbolic variables in the Symbolic Math Toolbox

atan2MATLAB

I want to compute the four-quadrant inverse tangent using symbolic variables.

Best Answer

As of Release 2013a (R2013a), the ATAN2 function in the Symbolic Math Toolbox provides this functionality. For previous product releases, read below for a workaround:
To compute the four-quadrant inverse tangent using symbolic variables created with the Symbolic Math Toolbox, use the ATAN function with two arguments. For example.
a = sym(1);
b = sym(8);
atan(a,b)