フィルターのクリア

Creating a submatrix from a matrix

242 ビュー (過去 30 日間)
Konstantinos
Konstantinos 2014 年 12 月 4 日
コメント済み: Ioannis Aggelos 2024 年 4 月 29 日
I want a code to create a matrix which consist of rows and columns of another matrix.
i.e. A (4X4) = [ 1 2 3 4; 5 6 7 8; 1 3 5 7; 2 4 6 8; ]
The submatrix B consist of the { 1, 2, 4 }rows of A and the { 2,3 }columns of A:
Β (3Χ2) = [ 2 3; 6 7; 4 6; ]
Any help could be useful.
Thanks in advance!
  1 件のコメント
said mohamed
said mohamed 2021 年 5 月 5 日
Using the matrix A = [5 1 11; 7 13 3; 8 5 2], the matrix B is constructed as B = [A A A; A A A; A A A]. Which of the following is the result of the operation K = L * J, made using the submatrices of matrix B, L = B (1: 3,3: 5) and J = B (2: 4,2: 3)?

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

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 12 月 4 日
編集済み: Azzi Abdelmalek 2014 年 12 月 4 日
A= [ 1 2 3 4; 5 6 7 8; 1 3 5 7; 2 4 6 8; ]
B=A([1 2 4],[2 3])
  6 件のコメント
Himalsha Dharmapala
Himalsha Dharmapala 2021 年 1 月 25 日
Thanks
said mohamed
said mohamed 2021 年 5 月 5 日
Using the matrix A = [5 1 11; 7 13 3; 8 5 2], the matrix B is constructed as B = [A A A; A A A; A A A]. Which of the following is the result of the operation K = L * J, made using the submatrices of matrix B, L = B (1: 3,3: 5) and J = B (2: 4,2: 3)?

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

その他の回答 (1 件)

VANSHUL CHOUDHARY
VANSHUL CHOUDHARY 2021 年 8 月 20 日
A = rand(4,3);
% Get those elements of A that are located in rows 3 to 4 and
% column 2 to 3.
sub_matrix = A(3:4,2:3);
  3 件のコメント
Dyuman Joshi
Dyuman Joshi 2023 年 11 月 12 日
@Justin Paulan, experiment with the methods shown in the Answers in this thread.
Ioannis Aggelos
Ioannis Aggelos 2024 年 4 月 29 日
wow that was helpful (it wasnt)

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by