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

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

Difficulty:Rate

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

10.76% Correct | 89.24% Incorrect
Last Solution submitted on Feb 05, 2023

Problem Comments

Solution Comments

Show comments
Who Deserves Your Praise? Discover the New Contribution Widget!
...
We are excited to announce another update to our Discussions area: the...

Problem Recent Solvers21

Suggested Problems

More from this Author7

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Go to top of page