Example:
in = magic(5)
in =
17 24 1 8 15 23 5 7 14 16 4 6 13 20 22 10 12 19 21 3 11 18 25 2 9
out = 23 5 7 14 16
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.
Your test suite contains an error. The desired output contains a 4 in the third row, even though the task is to remove every row with an element less than or EQUAL TO a 4.
In Your solution the last row contains 4. So probably You'd like to delete rows with at least one element smaller than 4.
Find the sum of all the numbers of the input vector
26537 Solvers
Extract leading non-zero digit
990 Solvers
Find the largest value in the 3D matrix
915 Solvers
How many trades represent all the profit?
467 Solvers
Sum the entries of each column of a matrix which satisfy a logical condition.
114 Solvers