Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x = rand(1,10);
actual = everyOther(x);
expected = x(1:2:length(x));
assert(isequal(actual, expected))
ans =
0.1877 0.7789 0.3000 0.8210 0.8073
|
2 | Pass |
x = rand(1,100);
actual = everyOther(x);
expected = x(1:2:length(x));
assert(isequal(actual, expected))
ans =
Columns 1 through 18
0.2065 0.4096 0.5844 0.9744 0.2849 0.8163 0.2517 0.5444 0.8734 0.5484 0.4256 0.9940 0.1295 0.4250 0.8602 0.1978 0.0986 0.9393
Columns 19 through 36
0.6011 0.8318 0.1632 0.9850 0.6224 0.9602 0.0072 0.0913 0.3197 0.8770 0.6887 0.7726 0.5319 0.2245 0.8214 0.7121 0.5400 0.5405
Columns 37 through 50
0.4963 0.8602 0.7462 0.6497 0.8186 0.9777 0.7218 0.1796 0.2295 0.3362 0.1943 0.3131 0.8024 0.1499
|
3 | Pass |
x = ['A' 'long' 'time' 'ago' 'in' 'a' 'galaxy' 'far' 'far' 'away'];
actual = everyOther(x);
expected = x(1:2:length(x));
assert(isequal(actual, expected))
ans =
'Aogiegiaaayafrwy'
|
Sort a list of complex numbers based on far they are from the origin.
4327 Solvers
874 Solvers
516 Solvers
Set some matrix elements to zero
290 Solvers
Rounding off numbers to n decimals
1050 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!