How to inverse matrix 128*6 in matlab?

5 ビュー (過去 30 日間)
Nandita  Sarkar
Nandita Sarkar 2022 年 2 月 9 日
編集済み: DGM 2022 年 2 月 9 日
I want to inverse my matrices 128*6 into 6*128.

採用された回答

Highphi
Highphi 2022 年 2 月 9 日
u = [1, 1; ...
2, 2; ...
3, 3];
uInverse = flip(u)
uInverse = 3×2
3 3 2 2 1 1
u = [1, 1; ...
2, 2; ...
3, 3];
u90 = rot90(u)
u90 = 2×3
1 2 3 1 2 3
u_neg90 = rot90(u, 3)
u_neg90 = 2×3
3 2 1 3 2 1
  1 件のコメント
DGM
DGM 2022 年 2 月 9 日
編集済み: DGM 2022 年 2 月 9 日
Using an asymmetric input allows some distinctions to be made. If the OP is trying to do linear algebra, transposition is probably what's intended.
u = [1, 4; ...
2, 5; ...
3, 6];
u_90 = rot90(u) % rotate 90
u_90 = 2×3
4 5 6 1 2 3
u_neg90 = rot90(u, 3) % rotate -90 (or 270)
u_neg90 = 2×3
3 2 1 6 5 4
u_tpose = u.' % transpose
u_tpose = 2×3
1 2 3 4 5 6
Note that transposition is a special case of permutation that only applies to 2D arrays. More generally, you can do:
u_tpose = permute(u,[2 1])
u_tpose = 2×3
1 2 3 4 5 6

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOperators and Elementary Operations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by