This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
M = [1 2 3;
4 5 6;
7 8 9];
P = [1 2 3]; Q= [1 2 3];
y_correct = [1,5,9];
assert(isequal(Matrix_VectorIndexes(M,P,Q),y_correct))
|
2 | Pass |
M = [2 5 8;
3 6 9;
4 7 10];
P = [1 3 2]; Q = [1 1 2];
y_correct = [2,4,6];
assert(isequal(Matrix_VectorIndexes(M,P,Q),y_correct))
|
3 | Pass |
M = [1 5 4;
7 9 6;
8 2 3];
P = 1:3; Q = 3:-1:1;
y_correct = [4,9,8];
assert(isequal(Matrix_VectorIndexes(M,P,Q),y_correct))
|
4 | Pass |
M = [1 5 4;
7 9 6;
8 2 3];
P = reshape(repmat((1:3)',[1,3]),[1,9]);
Q = reshape(repmat(1:3,[3,1]),[1,9]);
y_correct = M(:)';
assert(isequal(Matrix_VectorIndexes(M,P,Q),y_correct))
|
5 | Pass |
M = [1 5 4 2;
7 9 6 1;
8 2 3 5];
P = [2,1,3,2]; Q = 1:4;
y_correct = [7,5,3,1];
assert(isequal(Matrix_VectorIndexes(M,P,Q),y_correct))
|
895 Solvers
The sum of the numbers in the vector
426 Solvers
Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
297 Solvers
Side of an equilateral triangle
2595 Solvers
Matlab Basics II - Count rows in a matrix
255 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!