Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Create a matrix from a sub matrix?

I have a matrix of size N -by- N and I want to create a matrix (10 N) -by- (10 N), where each N -by- N block is a copy of the original matrix. I would like to do it without for loops.

I have tried with the function kron, but it only "enlarges" the original matrix.

How can I make this matrix?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You’re looking for repmat()

A = rand(10);  % Original 10 x 10 matrix
B = repmat(A, 10);  % Copied 10 times in each direction
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading