Cody

Problem 1259. It's race time again! Write a function that is at least twice as fast as the test suite call of repmat().

Created by Jeremy in Community

Given an input element x, and the dimensions, (m, n) return a matrix of size m x n filled with element x. This must be done in less than half the time that repmat(x, m, n) takes. This is the sequel to http://www.mathworks.com/matlabcentral/cody/problems/1237-it-s-race-time-write-a-faster-function-than-the-test-suite-call-of-unique.

Example: Input: repl_mat(2, 2, 5) Output: [2, 2, 2, 2, 2; 2, 2, 2, 2, 2];

Solution Stats

19.32% Correct | 80.68% Incorrect
Last solution submitted on Apr 17, 2019

Problem Comments