This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Complex matrix and read file

Tags: None
(comma "," separated)
dchen
Registered Member
Posts
13
Karma
0

Complex matrix and read file

Sun Aug 09, 2015 1:57 am
Hi:

I have two questions:
1. Is there a convenient way to initialize the complex matrix? Currently, I define the complex matrix
MatrixXcd A(N,N);
Then in order to give it values, I first define
MatrixXd B(N,N); MatrixXd C(N,N);
and put values in those two matrices, then I set
A.real() = B; A.imag() = C;
But if I have a small matrix, is there a more convenient way to initialize, like <<?

2. Can I easily read data from txt files to some matrices?

Thank you!


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]