repmat(1, 3) # same as ones(3)
repmat(1, c(3, 3)) # same thing
repmat(1, 3, 3) # same thing
repmat(1, size(matrix(NA, 3, 3))) # same thing
repmat(matrix(1:4, 2, 2), 3)
Run the code above in your browser using DataLab