repmatRepeat matrix
repmat(A, m)A should be an array. It duplicates and tiles A m times in the first (row) and second (column) dimensions of A.m is zero, it returns an empty array.repmat(A, s1, s2, ..., sn)A should be an array, and s1, s2, ..., sn are non-negative integers, not equal to Inf nor NaN. It duplicates and tiles A in the 1st, 2nd, ..., n-th dimensions s1, s2, ..., sn times, respectively. If any of s1, s2, ..., sn is zero, it returns an empty array.repmat(A, s)A should be an array, and s is a vector with non-negative integers s1, s2, ..., sn not equal to Inf nor NaN. It duplicates and tiles A in the 1st, 2nd, ..., n-th dimensions s1, s2, ..., sn times, respectively. If any of s1, s2, ..., sn is zero, it returns an empty array.r = rand(2,3,4)
rr = repmat(r,2)
r(:, :, 1) = 1e-1 ×
5.5763 2.6253 5.0971
3.0160 4.5756 5.0649
r(:, :, 2) = 1e-1 ×
9.1791 3.8848 6.9729
2.2900 3.8805 2.2782
r(:, :, 3) = 1e-1 ×
8.1343 8.4280 2.0847
1.9063 8.2422 7.4617
r(:, :, 4) = 1e-1 ×
5.5381 2.0987 1.4030
5.6323 1.0009 6.2362
rr(:, :, 1) = 1e-1 ×
5.5763 2.6253 5.0971 5.5763 2.6253 5.0971
3.0160 4.5756 5.0649 3.0160 4.5756 5.0649
5.5763 2.6253 5.0971 5.5763 2.6253 5.0971
3.0160 4.5756 5.0649 3.0160 4.5756 5.0649
rr(:, :, 2) = 1e-1 ×
9.1791 3.8848 6.9729 9.1791 3.8848 6.9729
2.2900 3.8805 2.2782 2.2900 3.8805 2.2782
9.1791 3.8848 6.9729 9.1791 3.8848 6.9729
2.2900 3.8805 2.2782 2.2900 3.8805 2.2782
rr(:, :, 3) = 1e-1 ×
8.1343 8.4280 2.0847 8.1343 8.4280 2.0847
1.9063 8.2422 7.4617 1.9063 8.2422 7.4617
8.1343 8.4280 2.0847 8.1343 8.4280 2.0847
1.9063 8.2422 7.4617 1.9063 8.2422 7.4617
rr(:, :, 4) = 1e-1 ×
5.5381 2.0987 1.4030 5.5381 2.0987 1.4030
5.6323 1.0009 6.2362 5.6323 1.0009 6.2362
5.5381 2.0987 1.4030 5.5381 2.0987 1.4030
5.6323 1.0009 6.2362 5.6323 1.0009 6.2362