sorry, this is cheating.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x = zeros(10,10,10); x(5,5,5) = 10;
y_correct = [5,5,5];
assert(isequal(Index_Max3d(x),y_correct))
ans =
function_handle with value:
@(x)ind2sub(size(x),find(x==max(x(:))))
|
2 | Pass |
x = randn(10,10,10); x(7,5,8) = 11;
y_correct = [7,5,8];
assert(isequal(Index_Max3d(x),y_correct))
ans =
function_handle with value:
@(x)ind2sub(size(x),find(x==max(x(:))))
|
3 | Pass |
x = randn(10,10,100); x(10,5,8) = 99;
y_correct = [10,5,8];
assert(isequal(Index_Max3d(x),y_correct))
ans =
function_handle with value:
@(x)ind2sub(size(x),find(x==max(x(:))))
|
4 | Pass |
x = randn(10,10,10); x(1,3,7) = 42;
y_correct = [1,3,7];
assert(isequal(Index_Max3d(x),y_correct))
ans =
function_handle with value:
@(x)ind2sub(size(x),find(x==max(x(:))))
|
5 | Pass |
x = randn(10,10,100); x(4,4,7) = 123456789;
y_correct = [4,4,7];
assert(isequal(Index_Max3d(x),y_correct))
ans =
function_handle with value:
@(x)ind2sub(size(x),find(x==max(x(:))))
|
6 | Pass |
x = randn(10,10,10); x(1,1,9) = 10701;
y_correct = [1,1,9];
assert(isequal(Index_Max3d(x),y_correct))
ans =
function_handle with value:
@(x)ind2sub(size(x),find(x==max(x(:))))
|
7 | Pass |
x = randn(10,10,100); x(1,7,3) = 10701;
y_correct = [1,7,3];
assert(isequal(Index_Max3d(x),y_correct))
ans =
function_handle with value:
@(x)ind2sub(size(x),find(x==max(x(:))))
|
Return the largest number that is adjacent to a zero
3749 Solvers
Sum all integers from 1 to 2^n
8414 Solvers
Project Euler: Problem 6, Natural numbers, squares and sums.
1018 Solvers
07 - Common functions and indexing 6
348 Solvers
Remove element(s) from cell array
373 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!