Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test
Code Input and Output
1
Pass
 
%%
x = 1.7;
m = 197;
n = 535;
tic
y_correct = repmat(x, m, n);
t_repmat = toc
tic
y_myrepmat = my_repmat(x, m, n);
t_myrepmat = toc
assert(isequal(y_myrepmat,y_correct) && t_myrepmat < t_repmat/2)
t_repmat =
    0.0070
ans =
  Columns 1 through 10
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000    1.7000
    1.7000    1.7000    1.7000    1.7000    1.7000...
2
Pass
 
%%
x = -0.3;
m = 1;
n = 5350;
tic
y_correct = repmat(x, m, n);
t_repmat = toc
tic
y_myrepmat = my_repmat(x, m, n);
t_myrepmat = toc
assert(isequal(y_myrepmat,y_correct) && t_myrepmat < t_repmat/2)
t_repmat =
   1.2400e-04
ans =
  Columns 1 through 10
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 11 through 20
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 21 through 30
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 31 through 40
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 41 through 50
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 51 through 60
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 61 through 70
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 71 through 80
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 81 through 90
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 91 through 100
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 101 through 110
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 111 through 120
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 121 through 130
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 131 through 140
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 141 through 150
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 151 through 160
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 161 through 170
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 171 through 180
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 181 through 190
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 191 through 200
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 201 through 210
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 211 through 220
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 221 through 230
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 231 through 240
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 241 through 250
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 251 through 260
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 261 through 270
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 271 through 280
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 281 through 290
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 291 through 300
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 301 through 310
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 311 through 320
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 321 through 330
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 331 through 340
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 341 through 350
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 351 through 360
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 361 through 370
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 371 through 380
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 381 through 390
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 391 through 400
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 401 through 410
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 411 through 420
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 421 through 430
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 431 through 440
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 441 through 450
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 451 through 460
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 461 through 470
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 471 through 480
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 481 through 490
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 491 through 500
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 501 through 510
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 511 through 520
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 521 through 530
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 531 through 540
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 541 through 550
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 551 through 560
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 561 through 570
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 571 through 580
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 581 through 590
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 591 through 600
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 601 through 610
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 611 through 620
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 621 through 630
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 631 through 640
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 641 through 650
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 651 through 660
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 661 through 670
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 671 through 680
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 681 through 690
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 691 through 700
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 701 through 710
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 711 through 720
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 721 through 730
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 731 through 740
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 741 through 750
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 751 through 760
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 761 through 770
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 771 through 780
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000
  Columns 781 through 790
   -0.3000   -0.3000   -0.3000   -0.3000   -0.3000   -0....
3
Fail
 
%%
x = 0;
m = 14;
n = 5350;
tic
y_correct = repmat(x, m, n);
t_repmat = toc
tic
y_myrepmat = my_repmat(x, m, n);
t_myrepmat = toc
assert(isequal(y_myrepmat,y_correct) && t_myrepmat < t_repmat)
t_repmat =
   3.2200e-04
ans =
  Columns 1 through 16
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
  Columns 17 through 32
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
  Columns 33 through 48
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
  Columns 49 through 64
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
  Columns 65 through 80
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
  Columns 81 through 96
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
  Columns 97 through 112
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
     0     0