How to get a square matrix out of a augmented matrix?

조회 수: 3 (최근 30일)
Shankhadeep Saha
Shankhadeep Saha 2021년 10월 18일
댓글: KSSV 2021년 10월 18일
Say there is a input square matrix: A
And we create a identity matrix of the same order as A and name it B
Then we create a augmented matrix Ag = [A, B]
now I perform some operation on the Ag matrix and now I want to print the changed B matrix within the Ag matrix. How can I do that?

답변 (1개)

KSSV
KSSV 2021년 10월 18일
n = 5 ;
A = rand(n) ; % square matrix
B = eye(size(A)) ; % Identity matrix
Ag = [A B] ; % augemented matrix
  댓글 수: 4
Shankhadeep Saha
Shankhadeep Saha 2021년 10월 18일
It worked! Thanks a lot!! :)
KSSV
KSSV 2021년 10월 18일
Thanks is acepting/ voting the answer. :)

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Sparse Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by