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];
MATLAB and Simulink resources for Arduino, LEGO, and Raspberry PiLearn more
Opportunities for recent engineering grads.Apply Today
New to MATLAB?Learn MATLAB today!
Play games and win prizes!Learn more