Problem 2817. Remove the positive integers.
Given array x (of integers), remove all the positive numbers and display ouput as y.
Example x=[1 -2 3 -4] , output is y=[-2 -4].
Solution Stats
Problem Comments
-
2 Comments
Matthew Caron
on 8 Jan 2015
Starter question.
Kyle Roe
on 29 Jul 2022
Need more test cases. Only having one can lead to people cheating the question.
Solution Comments
Show commentsProblem Recent Solvers255
Suggested Problems
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15465 Solvers
-
2228 Solvers
-
542 Solvers
-
Reverse the elements of an array
1002 Solvers
-
Create matrix of replicated elements
375 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!