Cody

Problem 45477. Problem for beginners

Solution 3476189

Submitted on 30 Oct 2020 at 7:38
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   Fail
x = reshape([1:10],[],1); y_correct = [1;3;4;5;7;8;10]; assert(isequal(your_fcn_name(x),y_correct))

x = 1 2 3 4 5 6 7 8 9 10

Matrix index is out of range for deletion. Error in your_fcn_name (line 3) x(2)=[];x(6)=[];x(9)=[]; Error in Test1 (line 3) assert(isequal(your_fcn_name(x),y_correct))

2   Fail
x=reshape([10:-1:1],[],1); y_correct=[10;8;7;6;4;3;1]; assert(isequal(your_fcn_name(x),y_correct))

x = 10 9 8 7 6 5 4 3 2 1

Matrix index is out of range for deletion. Error in your_fcn_name (line 3) x(2)=[];x(6)=[];x(9)=[]; Error in Test2 (line 3) assert(isequal(your_fcn_name(x),y_correct))

Suggested Problems

More from this Author9

Community Treasure Hunt

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

Start Hunting!