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?
You're looking for repmat()
A = rand(10); % Original 10 x 10 matrix
B = repmat(A, 10); % Copied 10 times in each direction
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.