Borrar filtros
Borrar filtros

All zeros result when concatenating a complex vector with its conjugate

1 visualización (últimos 30 días)
So, I have a double complex matrix, P, which is 15251x1024 and I want to convert it to a 15251x2048 matrix with hermitian symmetry in its rows. That means, I have to flip each row, calculate its conjugate and then concatenate both results. I tried to do so with the code below, but the result is that P has 0.000 + i0.000 value in every single cell.
aux_P = P;
frameSize=2048;
P = zeros(15251,frameSize);
for i =1:15251
P(i,:) = [aux_P(i,:), flip(conj(aux_P(i,:)))];
end
Does anybody knows where the error is? I tried to run it using the debugger, row by row, and the result is properly calculated, which blowed my mind.
PD: Sorry I can't attach the P.mat file, as it is larger than 5 MB, but it mostly has values different from 0.
EDIT: I changed P = zeros(15251,frameSize); to P = ones(15251,frameSize); and the result now is an all-1s matrix

Respuesta aceptada

Torsten
Torsten el 13 de Jul. de 2018
Editada: Torsten el 13 de Jul. de 2018
aux_P = P;
frameSize=2048;
P = zeros(15251,frameSize);
P = [aux_P, flip(conj(aux_P),2)];
works for me.

Más respuestas (0)

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Productos


Versión

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by