フィルターのクリア

All zeros result when concatenating a complex vector with its conjugate

1 回表示 (過去 30 日間)
Jesus Sanchez
Jesus Sanchez 2018 年 7 月 13 日
コメント済み: Jesus Sanchez 2018 年 7 月 13 日
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

採用された回答

Torsten
Torsten 2018 年 7 月 13 日
編集済み: Torsten 2018 年 7 月 13 日
aux_P = P;
frameSize=2048;
P = zeros(15251,frameSize);
P = [aux_P, flip(conj(aux_P),2)];
works for me.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by