Test | Status | 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 =
7.8600e-04
t_myrepmat =
1.7000e-05
|
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 =
9.3000e-05
t_myrepmat =
1.1000e-05
|
3 | Pass |
%%
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 =
7.2000e-05
t_myrepmat =
1.2000e-05
|
Return a list sorted by number of occurrences
1225 Solvers
363 Solvers
299 Solvers
Given a window, how many subsets of a vector sum positive
673 Solvers
Generate a vector like 1,2,2,3,3,3,4,4,4,4
1561 Solvers