Extracting two columns from 6-D complex double

3 vues (au cours des 30 derniers jours)
HAN-WEI WANG
HAN-WEI WANG le 27 Jan 2023
Commenté : HAN-WEI WANG le 27 Jan 2023
I have a 6-D complex double and want to only extract the last numbers in the brackets (i.e. 2041 2042 2043......) and the complex number into a 2-D complex array.
e.g. the array should look like
[2041 -2.3832e+02 + 9.7451e+01i]
[2042 2.4313+e02 + 8.3950e+01i]
.......and so on.
And I want to do this calculation to the second column: sqrt( real * real + imag * imag )
and let this calculation to become the new "second row", overwrite the complex numbers.
Any solution to that, please?
Huge thanks in advance!
  5 commentaires
DGM
DGM le 27 Jan 2023
So are you saying that the size is [1 1 1 1 1 2048]?
If so, there's only one column, so the mention of operating on different "columns" should probably be clarified.
If not, what is the size?
HAN-WEI WANG
HAN-WEI WANG le 27 Jan 2023
Not sure how I conveyed myself poorly... But the code provided by Matt J below did what I want to do!
Still appreciate you guys' help!

Connectez-vous pour commenter.

Réponse acceptée

Matt J
Matt J le 27 Jan 2023
T=table((1:numel(val))' , abs(val(:)).^2 )
  1 commentaire
HAN-WEI WANG
HAN-WEI WANG le 27 Jan 2023
Thanks! Your code did the trick!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Produits


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by