Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x = 5;
y_correct = ...
[1 1 1 1 0
1 0 0 0 1
1 1 1 1 0
1 0 0 0 1
1 1 1 1 0];
assert(isequal(your_fcn_name(x),y_correct))
|
2 | Pass |
x = 7;
y_correct = ...
[1 1 1 1 1 1 0
1 0 0 0 0 0 1
1 0 0 0 0 0 1
1 1 1 1 1 1 0
1 0 0 0 0 0 1
1 0 0 0 0 0 1
1 1 1 1 1 1 0]
assert(isequal(your_fcn_name(x),y_correct))
y_correct =
1 1 1 1 1 1 0
1 0 0 0 0 0 1
1 0 0 0 0 0 1
1 1 1 1 1 1 0
1 0 0 0 0 0 1
1 0 0 0 0 0 1
1 1 1 1 1 1 0
|
3 | Pass |
x = 11;
y_correct = ...
[1 1 1 1 1 1 1 1 1 1 0
1 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 1
1 1 1 1 1 1 1 1 1 1 0
1 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 1
1 1 1 1 1 1 1 1 1 1 0]
assert(isequal(your_fcn_name(x),y_correct))
y_correct =
1 1 1 1 1 1 1 1 1 1 0
1 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 1
1 1 1 1 1 1 1 1 1 1 0
1 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 1
1 1 1 1 1 1 1 1 1 1 0
|
Arrange Vector in descending order
4075 Solvers
Project Euler: Problem 9, Pythagorean numbers
282 Solvers
386 Solvers
"Low : High - Low : High - Turn around " -- Create a subindices vector
320 Solvers
Getting the indices from a vector
3206 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!