# 固有ベクトルの向き

8 views (last 30 days)
Kohei Nishizawa on 26 Sep 2022
Commented: Kohei Nishizawa on 29 Sep 2022

Kohei Nishizawa on 27 Sep 2022
ご丁寧にありがとうございます。

A = [-0.0449 -0.5388 -0.8413; -0.6687 0.6418 -0.3754; 0.7422 0.5457 -0.3891]
A(:,:,2) = [-0.0453 -0.5361 -0.8429; -0.6897 0.6272 -0.3618; 0.7227 0.5649 -0.3982]
A(:,:,3) = [0.0464 0.5318 -0.8456; 0.7089 -0.6139 -0.3472;-0.7038 -0.5834 -0.4055]
A(:,:,4) = [0.0469 -0.5288 -0.8475; 0.7276 0.5994 -0.3337;-0.6844 0.6010 -0.4128]

Hernia Baby on 27 Sep 2022

まずは準備
clc,clear
A = [-0.0449 -0.5388 -0.8413; -0.6687 0.6418 -0.3754; 0.7422 0.5457 -0.3891];
A(:,:,2) = [-0.0453 -0.5361 -0.8429; -0.6897 0.6272 -0.3618; 0.7227 0.5649 -0.3982];
A(:,:,3) = [0.0464 0.5318 -0.8456; 0.7089 -0.6139 -0.3472;-0.7038 -0.5834 -0.4055];
A(:,:,4) = [0.0469 -0.5288 -0.8475; 0.7276 0.5994 -0.3337;-0.6844 0.6010 -0.4128];
ここでAの符号を算出します
Sgn_A = sign(A)
Sgn_A =
Sgn_A(:,:,1) = -1 -1 -1 -1 1 -1 1 1 -1 Sgn_A(:,:,2) = -1 -1 -1 -1 1 -1 1 1 -1 Sgn_A(:,:,3) = 1 1 -1 1 -1 -1 -1 -1 -1 Sgn_A(:,:,4) = 1 -1 -1 1 1 -1 -1 1 -1
すべて1の行列を作成し、3番目と4番目の符号を1番目と2番目のものとかけることで反転すべきか決めます
idx = ones(size(A));
for ii = 1:size(A,3)/2
idx(:,:,ii+2) = Sgn_A(:,:,ii).*Sgn_A(:,:,ii+2);
end
B = A.*idx;
Bの符号を見てみましょう
sign(B)
ans =
ans(:,:,1) = -1 -1 -1 -1 1 -1 1 1 -1 ans(:,:,2) = -1 -1 -1 -1 1 -1 1 1 -1 ans(:,:,3) = -1 -1 -1 -1 1 -1 1 1 -1 ans(:,:,4) = -1 -1 -1 -1 1 -1 1 1 -1
1,2番目と対応していることがわかりました

Kohei Nishizawa on 28 Sep 2022
ありがとうございます。非常に参考になります。 ちなみに1番目、2番目と3番目、4番目の各列ベクトルの向きを合わせるという条件ですと他に方法は考えられますでしょうか？
Kohei Nishizawa on 29 Sep 2022

A = [-0.0449 -0.5388 -0.8413; -0.6687 0.6418 -0.3754; 0.7422 0.5457 -0.3891];
A(:,:,2) = [-0.0453 -0.5361 -0.8429; -0.6897 0.6272 -0.3618; 0.7227 0.5649 -0.3982];
A(:,:,3) = [0.0464 0.5318 -0.8456; 0.7089 -0.6139 -0.3472;-0.7038 -0.5834 -0.4055];
A(:,:,4) = [0.0469 -0.5288 -0.8475; 0.7276 0.5994 -0.3337;-0.6844 0.6010 -0.4128];
B = [-0.0412 -0.7211 -0.6916; -0.0365 0.6928 -0.7202; 0.9985 -0.0045 -0.0549];
B(:,:,2) = [-0.0417 -0.7310 -0.6811; -0.0515 0.6823 -0.7292; 0.9978 0.0046 -0.0661];
C = cat(3,A,B)
C =
C(:,:,1) = -0.0449 -0.5388 -0.8413 -0.6687 0.6418 -0.3754 0.7422 0.5457 -0.3891 C(:,:,2) = -0.0453 -0.5361 -0.8429 -0.6897 0.6272 -0.3618 0.7227 0.5649 -0.3982 C(:,:,3) = 0.0464 0.5318 -0.8456 0.7089 -0.6139 -0.3472 -0.7038 -0.5834 -0.4055 C(:,:,4) = 0.0469 -0.5288 -0.8475 0.7276 0.5994 -0.3337 -0.6844 0.6010 -0.4128 C(:,:,5) = -0.0412 -0.7211 -0.6916 -0.0365 0.6928 -0.7202 0.9985 -0.0045 -0.0549 C(:,:,6) = -0.0417 -0.7310 -0.6811 -0.0515 0.6823 -0.7292 0.9978 0.0046 -0.0661

### Categories

Find more on 記述統計 in Help Center and File Exchange

R2022a

### Community Treasure Hunt

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

Start Hunting!