small matrix in big matrix

I want to put a small matrix (p*q) called B into a bigger matrix (m*n) called A. How can I do it. Matrix B should be put on the left-right corner of matrix A.

댓글 수: 3

Image Analyst
Image Analyst 2013년 6월 2일
편집: Image Analyst 2013년 6월 2일
Why do you post this when you had a better version of this question already posted at http://www.mathworks.com/matlabcentral/answers/77743-put-a-small-matrix-in-a-bigger-one 40 minutes earlier. Please don't duplicate questions. I already answered there for you.
the cyclist
the cyclist 2013년 6월 2일
편집: the cyclist 2013년 6월 2일
[Sorry. Couldn't resist teasing the master!]

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

 채택된 답변

the cyclist
the cyclist 2013년 6월 2일

1 개 추천

I don't know what "left-right corner" means, but in general you can do this as:
A = magic(7);
B = magic(3);
A(2:4,3:5) = B;

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

질문:

2013년 6월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by