How can i extract sub matrix from basic matrix

Hello. My basic matrix is
B=[-1,1,1,5+i*2;0,-1,0,20+i*10;0,0,-1,10+i*3;1,0,0,0;30+i*30,50+i*50,60+i*60,0]
Sub matrix is A
A=[-1,1,1;0,-1,0;0,0,-1;1,0,0]

 採用された回答

Walter Roberson
Walter Roberson 2013 年 6 月 7 日

0 投票

A = B(1:4, 1:3);

2 件のコメント

Dulam Sai Namratha Naidu
Dulam Sai Namratha Naidu 2020 年 2 月 5 日
could you please explain me this code.
welzheimerwald
welzheimerwald 2022 年 4 月 2 日
@Dulam Sai Namratha Naidu it generates a 4x3 sub matrix of matrix B with rows 1,2,3,4 and colums 1,2,3 from matrix B.

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

その他の回答 (2 件)

Navadeep Ganesh U
Navadeep Ganesh U 2019 年 12 月 1 日
編集済み: Navadeep Ganesh U 2019 年 12 月 1 日

5 投票

A=B([1,2,3],[1,2,3])
means, We need to extract B's 1st 2nd and 3rd row along with B's 1st 2nd and 3rd column.
By this you can get approprite answer.
It can also be written as A=B([1:3],[1:3])
LoL,...............6yrs later

5 件のコメント

Griffen Morrison
Griffen Morrison 2020 年 2 月 12 日
Hey if your explination didnt help the original poster it some random person years later to understand the code. Thanks!
Wehann Landsberg
Wehann Landsberg 2020 年 7 月 30 日
Yeah, someone like me :)
aniss skalli
aniss skalli 2020 年 12 月 6 日
and like me
Rafael Olaru
Rafael Olaru 2021 年 2 月 23 日
or like me :D
Brandon Fenske
Brandon Fenske 2022 年 9 月 2 日
THANK YOU

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

sunny
sunny 2024 年 2 月 17 日

0 投票

B=[-1,1,1,5+1i*2;0,-1,0,20+1i*10;0,0,-1,10+1i*3;1,0,0,0;30+1i*30,50+1i*50,60+1i*60,0];
B(:,end)=[];
B(end,:)=[];

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

質問済み:

2013 年 6 月 7 日

回答済み:

2024 年 2 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by