Problem 42481. Low level NaN
- I have a dataset. Columns represents different variables.
- A variable may start with NaN or any double type number.
- If it starts with double number it continues with double type numbers.
- If it starts with NaN, we do not know when it ends.
- Return the row index where last NaN is observed in overall dataset. (Think column-wise)
Input
[ 1 NaN 5 NaN 2
2 NaN 4 4 8
6 NaN 8 2 4
0 0 0 0 0]
should return 3 because last NaN is observed in third row.
Test suite may be changed!
Solution Stats
Problem Comments
-
3 Comments
Alfonso Nieto-Castanon
on 31 Jul 2015
there seem to be some problems with the testsuite, in particular some of those matrices contain different number of elements per row (e.g. perhaps "5,7" should be "5.7"). I guess the same applies to your example dataset where the last row contains only four numbers instead of five?
Mehmet OZC
on 1 Aug 2015
I have fixed test suite.
Christian Schröder
on 23 Oct 2022
The example from the problem description isn't a valid matrix; the last row has 4 entries rather than 5.
Solution Comments
Show commentsProblem Recent Solvers63
Suggested Problems
-
885 Solvers
-
Back to basics 23 - Triangular matrix
1009 Solvers
-
Returning a "greater than" vector
257 Solvers
-
Matlab Basics - y as a function of x
498 Solvers
-
Matrix of almost all zeros, except for main diagonal
183 Solvers
More from this Author92
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!