This solution is outdated. To rescore this solution, sign in.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
filetext = fileread('largest.m');
assert(isempty(strfind(filetext, 'regexp')),'regexp hacks are forbidden')
assert(isempty(strfind(filetext, 'max')),'max() forbidden')
assert(isempty(strfind(filetext, 'min')),'min() forbidden')
assert(isempty(strfind(filetext, 'sort')),'sort() forbidden')
|
2 | Pass |
v = [4 7 1 6];
x_correct = 7;
assert(isequal(largest(v),x_correct))
a =
7
c =
7
d =
7
x =
7
|
3 | Pass |
v = [1 1 1 1];
x_correct = 1;
assert(isequal(largest(v),x_correct))
c =
1
d =
1
x =
1
|
4 | Pass |
v = [4 3 2 1];
x_correct = 4;
assert(isequal(largest(v),x_correct))
c =
4
d =
4
x =
4
|
5 | Pass |
v = [1 2 3 4];
x_correct = 4;
assert(isequal(largest(v),x_correct))
a =
2
b =
3
c =
4
x =
4
|
6 | Pass |
v = [1 1 3 5];
x_correct = 5;
assert(isequal(largest(v),x_correct))
b =
3
c =
5
x =
5
|
7 | Pass |
v = [3 3 2 4];
x_correct = 4;
assert(isequal(largest(v),x_correct))
c =
3
c =
4
x =
4
|
8 | Pass |
v = [2 3 1 6];
x_correct = 6;
assert(isequal(largest(v),x_correct))
a =
3
c =
3
c =
6
x =
6
|
9 | Pass |
v = [3 3 3 9];
x_correct = 9;
assert(isequal(largest(v),x_correct))
c =
3
c =
9
x =
9
|
819 Solvers
3971 Solvers
Getting the row and column location from a matrix
236 Solvers
338 Solvers
Solving Quadratic Equations (Version 1)
427 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!