MATLAB Answers

How can i extract sub matrix from basic matrix

조회 수: 546(최근 30일)
Light
Light 7 Jun 2013
댓글: Griffen Morrison 12 Feb 2020 17:17
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]

  댓글 수: 0

로그인 to comment.

채택된 답변

Walter Roberson
Walter Roberson 7 Jun 2013
A = B(1:4, 1:3);

  댓글 수: 1

Dulam Sai Namratha Naidu
Dulam Sai Namratha Naidu 5 Feb 2020 16:01
could you please explain me this code.

로그인 to comment.

추가 답변(1개)

Navadeep Ganesh U
Navadeep Ganesh U 1 Dec 2019
편집: Navadeep Ganesh U 1 Dec 2019
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

  댓글 수: 1

Griffen Morrison
Griffen Morrison 12 Feb 2020 17:17
Hey if your explination didnt help the original poster it some random person years later to understand the code. Thanks!

로그인 to comment.

이 질문에 답변하려면 로그인을(를) 수행하십시오.


Translated by