Cody

Problem 43272. Implement zero-based indexing for Matrices

Solution 2745745

Submitted on 27 Jul 2020 by Raghunadh N
  • Size: 13
  • This is the leading solution.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
x = [1 2 4 5]; pos = [0 2] y_correct = 4; assert(isequal(zeroBasedMN(x,pos),y_correct))

pos = 0 2

2   Pass
x = [1 2 3 4 5; 6 7 8 9 0]; pos = [1 3]; y_correct = 9 assert(isequal(zeroBasedMN(x,pos),y_correct))

y_correct = 9

Suggested Problems

More from this Author43

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!