필터 지우기
필터 지우기

insert a small matrix inside a big matrix

조회 수: 26 (최근 30일)
Anvinder  Singh
Anvinder Singh 2016년 5월 25일
댓글: oliver murray 2020년 11월 4일
i have a 1000 x 1000 matrix and a 45 x 45 matrix. both have random numbers. how can i insert the small matrix in the bigger one at a given location. lets say i want to insert the small matrix from 250 x 250 onwards. How do i do it ? I do not want the elements of the big matrix to become zero for all other places left after inserting the smaller matrix, i mean padding the small matrix with zeros wont be helpful in this case. Please assist.

답변 (1개)

Todd Leonhardt
Todd Leonhardt 2016년 5월 25일
You do it like so. Suppose your 1000 x 1000 matrix is called big and your 45x45 matrix is called little.
big(250:294, 250:294) = little;
  댓글 수: 6
Alyssa Martinez
Alyssa Martinez 2019년 2월 20일
How did you get 250:294 in there?
oliver murray
oliver murray 2020년 11월 4일
250 to 294 is 45 places

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

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by