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 件のコメント

KSSV
KSSV 2023 年 1 月 27 日
What is the dimension/ size of the array?
HAN-WEI WANG
HAN-WEI WANG 2023 年 1 月 27 日
It is a 6-D array with the first five dimension being identical ( : , : , 1 , 1 , 1 )
the size should be 2048.
KSSV
KSSV 2023 年 1 月 27 日
( : , : , 1 , 1 , 1 )
What is :,:, dimension ?
DGM
DGM 2023 年 1 月 27 日
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 2023 年 1 月 27 日
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!

サインインしてコメントする。

 採用された回答

Matt J
Matt J 2023 年 1 月 27 日

0 投票

T=table((1:numel(val))' , abs(val(:)).^2 )

1 件のコメント

HAN-WEI WANG
HAN-WEI WANG 2023 年 1 月 27 日
Thanks! Your code did the trick!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMatrix Indexing についてさらに検索

製品

リリース

R2022b

タグ

質問済み:

2023 年 1 月 27 日

コメント済み:

2023 年 1 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by