Effacer les filtres
Effacer les filtres

All zeros result when concatenating a complex vector with its conjugate

1 vue (au cours des 30 derniers jours)
Jesus Sanchez
Jesus Sanchez le 13 Juil 2018
Commenté : Jesus Sanchez le 13 Juil 2018
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

Réponse acceptée

Torsten
Torsten le 13 Juil 2018
Modifié(e) : Torsten le 13 Juil 2018
aux_P = P;
frameSize=2048;
P = zeros(15251,frameSize);
P = [aux_P, flip(conj(aux_P),2)];
works for me.

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by