简体   繁体   English

倍频的复数矩阵

[英]Complex matrix in octave

I'm using Octave in my cpp code to perform matrix manipulations. 我在我的cpp代码中使用Octave执行矩阵操作。 Sample code is given below: 示例代码如下:

Matrix matr = Matrix (5,4);
for (int r=0;r<5;r++)
{
     for(int c=0;c<4;c++)
     {
         matr(r,c)=(r+c);
     }
} 

How do I declare a complex 2D matrix and pass both real and imaginary values to the matrix? 如何声明一个复杂的2D矩阵并将实值和虚值都传递给该矩阵?

#include <CMatrix.h>
...
ComplexMatrix matr = ComplexMatrix (5,4);
...
matr (r,c) = complex (r, c);
...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM