I'm importing in Matlab a matrix in u/v coordinates but I need them in theta/phi coordinates. I found out that there exist the function uv2phitheta
and according to the help this function gives in output a 2 row matrix for the theta/phi components and the value of the cell that I need to convert need to be <=1 . https://www.mathworks.com/help/phased/ref/uv2phitheta.html
I want to convert each element of the matrix in theta/phi, therefore to a single element of my matrix, converted I should get a matrix for the theta component and a matrix for the phi component. tried to implement something like this
for u=1:size(s_H)
for v=1:size(s_h)
s_H=uv2phitheta(s_H(u,v));
end
end
but it doesn't work giving me these errors
Error using uv2phitheta Expected UV to be an array with all of the values <= 1.
Error in uv2phitheta (line 29) validateattributes(uv,{'double'},{'2d','real','>=',-1,'<=',1},...
The elements of my matrix s_H are not between (-1,1) but are real numbers. I don't know if I should normalize it.