How to get three sub matrices from a matrix of any order? How we will do for general matrix? I have given an example of order 5.

1 回表示 (過去 30 日間)
For example:
A= [1 4 5 7 8;
4 2 6 9 10;
5 6 3 1 1;
7 9 1 3 5;
8 10 1 5 4];
Ist sub matrix is A11=[1 4 5; 4 2 6 ; 5 6 3]; order should be 3by3,
2nd sub matrix is B11=[7 9 1; 8 10 1]; order should be 2by3,
3rd sub matrix is C11=[3 5; 5 4]; order should be 2by2.
  3 件のコメント
Farooq Aamir
Farooq Aamir 2018 年 10 月 28 日
@ Walter Roberson, A has some special structure so that's why I divide A into this way. (e.g Hamiltonian matrix)
Walter Roberson
Walter Roberson 2018 年 10 月 28 日
If it had been order 7 then which parts would you need?

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

採用された回答

madhan ravi
madhan ravi 2018 年 10 月 28 日
A= [1 4 5 7 8;
4 2 6 9 10;
5 6 3 1 1;
7 9 1 3 5;
8 10 1 5 4];
A11=a(1:3,1:3)
B11=a(1:3,end-1:end)
C11=a(end-1:end, end-1:end)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by