Problem 774. Remove from a 2-D matrix all the rows that contain at least one element less than or equal to 4
Solution Stats
Problem Comments
-
11 Comments
In the example the output is a vector, not a matrix as during the test run.
The example output is missing row 3.
In row 3, the element 4 is not less than 4 but less than or equal to 4 or greater than or equal to 4. This is the reason for removing this row.
I'm still puzzled by your example. Row 3 has no elements less than 4, therefore it should NOT be removed, right? But it was removed. That seems wrong. For this example to be correct, the problem should be called "Remove from a 2-D matrix all the rows that contain at least one element less than or equal to 4".
Thanks for making the change! It's a good problem.
The title and example are consistent. However the test case only removes rows with at least 1 element less than 4, which disagrees with title and example.
Need to modify the test case.
Please modify either the test suite or the title to be consistent.
I agree you should change the test to match the question. Also, perhaps add more than one test.
Your test suite is has an incorrect answer, the last row contains a 4.
Test suite has been corrected and additional cases are added.
Solution Comments
Show commentsProblem Recent Solvers135
Suggested Problems
-
Return the largest number that is adjacent to a zero
5342 Solvers
-
1596 Solvers
-
Find the sum of the elements in the "second" diagonal
1149 Solvers
-
Getting the indices from a matrix
648 Solvers
-
437 Solvers
More from this Author10
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!