1) Since you are already using Matlab, use the built-in function, cart2pol.
MathWorks - CART2POL
2) Most handheld scientific calculators have a method to convert coordinates from rectangular to polar form, and back again.
3) If you want to do the trig, the vector magnitude is the length of the hypotenuse of a triangle with sides of length x and y (think Pythagorean theorem... c^2 = a^2 + b^2 ).
Calculating the angle is a little more tricky. The angle is always determined as a vector starting from pointing along the positive x-axis. So, if your vector is in the upper-right quadrant (positive x, positive y), then theta = arctan(|y|/|x|). However, if your vector is in the upper-left quadrant, then the arc-tangent will give you the angle from the
negative x-axis, so you will have to take 180-arctan(|y|/|x|) to get the angle starting from the
positive x-axis. Similar adjustments to the triangle's included angle need to be done for the lower-left quadtrant ( arctan(|y|/|x|)+180 ), and the lower-right quadrant ( 360-arctan(|y|/|x|) ).
There are other ways to calculate and represent the angles, but this should help you get some insight into the method of conversion from rectangular to polar coordinates. Draw the four cases out and follow what angle the arctan is calculating, and why you need to compensate with 180-, +180 and 360- for those three quadrants.