I have the following array:
complex = [4+1j, 4+ 0j , 4 + 2j]
is there an efficient way to convert to the magnitude( like this pseudo code):