Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Problem 940. R2012b atan in Degrees

Created by Richard Zapor

Return in degrees the atan result of inputs for all four quadrants.

Examples:

[x, y] Degrees
 1  0     0
 1  1    45
-1  1   135
-1 -1  -135
 1 -1   -45
-1  0  -180
 0 -1   -90

Input: [ x , y ]

Output: Angle : Degrees [ 0:180 ] ( -180:0 ) -180 is not a valid return value

Note: Input to atan2 is Y , X not X , Y

Matlab Whatsnew

R2012b Update Note

Problem Group

Solution Statistics

36 correct solutions 16 incorrect solutions
Last solution submitted on Jun 23, 2014