Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
tic
|
2 | Pass |
x = 5; y_correct = 5; assert(isequal(hamming1(x),y_correct))
y =
5
|
3 | Pass |
x = 100; y_correct = 34; assert(isequal(hamming1(x),y_correct))
y =
34
|
4 | Pass |
x = 123456; y_correct = 327; assert(isequal(hamming1(x),y_correct))
y =
327
|
5 | Pass |
x = 10^13; y_correct = 4301; assert(isequal(hamming1(x),y_correct))
y =
4301
|
6 | Pass |
x=1:20; y=arrayfun(@(z) hamming1(z),2.^x);
y_correct=[2 4 7 12 19 27 38 52 68 87 110 137 167 201 240 284 332 386 446 511];
assert(isequal(y,y_correct));
tval=1000*toc
feval( @assignin,'caller','score',floor(min(5000,tval )) );
y =
2
y =
4
y =
7
y =
12
y =
19
y =
27
y =
38
y =
52
y =
68
y =
87
y =
110
y =
137
y =
167
y =
201
y =
240
y =
284
y =
332
y =
386
y =
446
y =
511
tval =
118.0530
|
First non-zero element in each column
593 Solvers
Back to basics 19 - character types
225 Solvers
224 Solvers
436 Solvers
262 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!