Azzera filtri
Azzera filtri

All zeros result when concatenating a complex vector with its conjugate

1 visualizzazione (ultimi 30 giorni)
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

Risposta accettata

Torsten
Torsten il 13 Lug 2018
Modificato: Torsten il 13 Lug 2018
aux_P = P;
frameSize=2048;
P = zeros(15251,frameSize);
P = [aux_P, flip(conj(aux_P),2)];
works for me.

Più risposte (0)

Categorie

Scopri di più su Matrices and Arrays in Help Center e File Exchange

Prodotti


Release

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by