Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
A=[a_11, a_12; a_21, a_22]
スキュー対角線は[a_12, a_21]です。今、私は行列をひっくり返して diag を使っています。
[a_12, a_21]
fliplrとの代わりにdiag、次のように行列に直接インデックスを付けることができます。
fliplr
diag
A = magic(3); s = length(A); idx = s:(s-1):(s*(s-1)+1); %# for anti-diagonal, use the following %#idx = (s*(s-1)+1):(-s+1):s; skewDiag = A(idx) skewDiag = 4 5 6