Borrar filtros
Borrar filtros

insert a small matrix inside a big matrix

25 visualizaciones (últimos 30 días)
Anvinder  Singh
Anvinder Singh el 25 de Mayo de 2016
Comentada: oliver murray el 4 de Nov. de 2020
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.

Respuestas (1)

Todd Leonhardt
Todd Leonhardt el 25 de Mayo de 2016
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 comentarios
Alyssa Martinez
Alyssa Martinez el 20 de Feb. de 2019
How did you get 250:294 in there?
oliver murray
oliver murray el 4 de Nov. de 2020
250 to 294 is 45 places

Iniciar sesión para comentar.

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by