Borrar filtros
Borrar filtros

read text file to get complex number

1 visualización (últimos 30 días)
qas abd
qas abd el 1 de Abr. de 2017
Editada: John D'Errico el 3 de Mzo. de 2024
Hi all, I have a data of vector from 1:1000 saved in REAL_I.text file another vector from 1:1000 saved in IMAG_Q.text file. how can i read them to get complex_IQ=real + j*imag. (vector numbers like this 5e-011 0.000225206230). thanks in advance

Respuestas (1)

John D'Errico
John D'Errico el 3 de Mzo. de 2024
Editada: John D'Errico el 3 de Mzo. de 2024
Read the files in as two vectors. There are many tools that can read a text file.
Then add them, multiplying the second by sqrt(-1).
r = rand(1,3)
r = 1x3
0.7565 0.8779 0.0298
im = rand(1,3)
im = 1x3
0.1435 0.9231 0.8388
r + sqrt(-1)*im
ans =
0.7565 + 0.1435i 0.8779 + 0.9231i 0.0298 + 0.8388i

Categorías

Más información sobre Data Import and Analysis en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by