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
-
Return the 3n+1 sequence for n
7385 Solvers
-
What is the distance from point P(x,y) to the line Ax + By + C = 0?
340 Solvers
-
07 - Common functions and indexing 1
408 Solvers
-
322 Solvers
-
774 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!