MATLAB: I want to create a MATLAB code for a matrix of m*n which have each element p*p matrix, plz help to solve this

matrix element matrix

Like I have a matrix A=[1 2;3 4] Now I want to generate B=[A A A;A A A] provide code for B.

Best Answer

A=[1 2;3 4]
B=[A A A;A A A]
You might prefer
B = repmat(A, 2, 3)