function z = polar2cartesian(r, theta); a = r*cos((theta*pi)/180); b = r*sin((theta*pi)/180); z = a+j*b;