Problem 307. First non-zero element in each column
Solution Stats
Problem Comments
-
2 Comments
I fixed the test. There was no assert statement.
Test cases have been added.
Solution Comments
-
1 Comment
The test is wrong, the right answer is y_correct = [2 1 3 2];
-
2 Comments
solution is incorrect
Not really, we need to determine the first non-zero element in each column, not row.
-
1 Comment
Except for the cheating part, this is the most elegant solution to this problem. Nice job!
-
1 Comment
The problem is pretty stupid, if there's only one test case. Then you can just return the correct result for this test case, without really computing anything (which is what the "best" solution to this problem does.
-
1 Comment
the best answer ! thanks
-
1 Comment
It looks like I forgot to put in size(x,2) instead of 4. Apparently the test suite didn't check that.
-
1 Comment
yup, definitely an issue...
-
1 Comment
houston we have a problem...
-
1 Comment
Even you!
Problem Recent Solvers849
Suggested Problems
-
The Goldbach Conjecture, Part 2
1934 Solvers
-
Find the sum of the elements in the "second" diagonal
1096 Solvers
-
Solve the set of simultaneous linear equations
363 Solvers
-
267 Solvers
-
Create matrix of replicated elements
363 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!