Create complex matrix from two matrices
mri2c rm:=[MBook1]MSheet1!mat(1) im:=[MBook2]MSheet1!mat(1) cm:=<new>;
Please refer to the page for additional option switches when accessing the x-function from script
Input
MatrixObject
Specifies the input matrix that has the real parts of the complex numbers.
Specifies the input matrix that has the imaginary parts of the complex numbers.
Output
Specifies the output matrix where the complex numbers will be saved.
See the syntax here.
The mc2ri function combines real numbers in two matrices into complex numbers. The two input matrices should have the real parts and the imaginary parts of the complex numbers, respectively.
/* In this example, a complex matrix is generated from two matrices that have the real parts and imaginary parts of the complex numbers. Then we calculate the amplitudes and phases of the complex numbers. 1. Fill two matrices with real numbers. 2. Combine these two matrices into a complex matrix. 3. Calculate the amplitudes and phases. */ window -t m; //Create a matrix for the real parts matrix -v sin(x)+cos(2*y); //Set matrix value. range m1=<active>; window -t m; //Create a matrix for the imaginary parts matrix -v sin(2*x)+cos(y); //Set matrix value. mri2c rm:=m1 im:=<active>; //Generate the complex matrix mc2ap; //Calculate the amplitudes and phases
mc2ri, map2c, mc2ap
Keywords:real, complex numbers