Cody

Problem 1988. Remove the middle element from a vector

Solution 2908273

Submitted on 3 Sep 2020 by Ramesh Kumar V
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,3]; y_correct = 2; assert(isequal(remove_middle(x),y_correct))

z = logical 0 m = 3

2   Pass
x = [1,2,3,4]; y_correct = 2; assert(isequal(remove_middle(x),y_correct))

z = logical 0 m = 4

3   Pass
x = []; y_correct = []; assert(isequal(remove_middle(x),y_correct))

z = logical 1 y = []

Suggested Problems

Community Treasure Hunt

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

Start Hunting!