Has the function rect2polar(Z) been removed in Version 4.0?
This function was used to convert complex number from rectangular form
to polar form.
Im my new version Scilab 4.0 it doesnt work.
Many thanks for your answer
JM
function [r,th]=rect2pol(x,y)
//rectangle to polar coordinate conversion
//based on "Scilab from a Matlab User's Point of View", Eike Rietsch,
2002
r=sqrt(x^2+y^2);
th = atan(y,x)*180/%pi;
endfunction
function [r,th]=cr2pol(a)
//complex number rectangle to polar conversion above
[r,th]=rect2pol(real(a),imag(a));
endfunction
-->[mag,ang]=rect2pol(1,1)
ang =
45.
mag =
1.4142136
-->c=0+1*%i
c =
i
-->[mag2,ang2]=cr2pol(c)
ang2 =
90.
mag2 =
1.