Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
y = kurchan_5x5
uy=unique(y(:));
assert(isequal(uy,[1:25]'));
dg = @(mm) spdiags([mm mm],1:length(mm));
py=prod([y y' dg(y) dg(flipud(y))]);
cody_score=max(py)-min(py);
fprintf('Maximum product of your matrix = %.0f \n',max(py))
fprintf('Minimum product of your matrix = %.0f \n',min(py))
fprintf('Kurchan score of your matrix = %.0f \n',cody_score)
feval(@assignin,'caller','score',cody_score);
ans =
17 24 1 8 15
23 5 7 14 16
4 6 13 20 22
10 12 19 21 3
11 18 25 2 9
y =
17 24 1 8 15
23 5 7 14 16
4 6 13 20 22
10 12 19 21 3
11 18 25 2 9
Maximum product of your matrix = 6375600
Minimum product of your matrix = 120
Kurchan score of your matrix = 6375480
|
900 Solvers
Back to basics 12 - Input Arguments
525 Solvers
Return elements unique to either input
550 Solvers
Convert a vector into a number
503 Solvers
130 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!