フィルターのクリア

Return only the real nullspace of a complex matrix

5 ビュー (過去 30 日間)
Martin Seltmann
Martin Seltmann 2018 年 10 月 24 日
コメント済み: Torsten 2018 年 10 月 24 日
I need to restrict the computation of the nullspace of a complex matrix A to one over the REAL numbers. How do I do that? null(A,’Real’) did not work.
  2 件のコメント
Torsten
Torsten 2018 年 10 月 24 日
It's not clear what you mean. You want to know if kern(A) contains purely real vectors ?
Martin Seltmann
Martin Seltmann 2018 年 10 月 24 日
Yes, and extract only those.

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

採用された回答

Bruno Luong
Bruno Luong 2018 年 10 月 24 日
編集済み: Bruno Luong 2018 年 10 月 24 日
A = randn(2,5)+1i*randn(2,5);
% N is a real orthonormal basis of null(A)
n = size(A,2);
NR=null([[real(A), imag(A)]; [-imag(A), real(A)]; [zeros(n), eye(n)]]);
N=NR(1:n,:);
% Check
norm(A*N)
  4 件のコメント
Torsten
Torsten 2018 年 10 月 24 日
If x is real valued and A*x = 0, you have (real(A)+i*imag(A))*x = 0. This implies that real(A)*x = 0 and imag(A)*x=0.
Conversely, if real(A)*x=0 and imag(A)*x=0 for a real vector x, then real(A)*x+i*imag(A)*x = A*x = 0.
Best wishes
Torsten.
Martin Seltmann
Martin Seltmann 2018 年 10 月 24 日
Of course, no clue why I was confused there. Thanks!

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

その他の回答 (1 件)

Bruno Luong
Bruno Luong 2018 年 10 月 24 日
編集済み: Bruno Luong 2018 年 10 月 24 日
Torsten proposition:
NR = null([real(A);imag(A)]);
Torsten is right, it's actually the same null space, and his formula is much simpler.
Because
real(A)*NR = 0
imag(A)*NR = 0
so
A*NR = (real(A)+1i*imag(A))*NR = real(A)*NR + 1i*(imag(A)*NR) = 0
The opposite is also true.
Since
A*NR = 0 in the complex field
because NR is real, therefore the above is equivalent to
real(A)*NR = 0
and because
A*(1i*NR) = 0
as well, this implies
imag(A)*NR = 0
  3 件のコメント
Bruno Luong
Bruno Luong 2018 年 10 月 24 日
編集済み: Bruno Luong 2018 年 10 月 24 日
You should't accept my comment, but Torsten's reply (if he put his code in a separate answer)
Torsten
Torsten 2018 年 10 月 24 日
You were the first who answered ( and your answer is not wrong :-) )
Best wishes
Torsten.

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

カテゴリ

Help Center および File ExchangeParallel Computing Fundamentals についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by