Problem 2803. Split up vector or matrix delimited by NaNs
Solution Stats
Problem Comments
-
5 Comments
The problem suite doesn't function properly. The following statement is the culprit:
assert(isequal(c = split_nan_delimited(x), y_correct))
and can be changed to:
assert(isequal(split_nan_delimited(x), c_correct))
for all the test cases.
Furthermore, do not test for emptiness with isequal. Use isempty instead. There are many ways to generate empty cell arrays and matrices in Matlab, none of which are equal with isequal.
Doh! Embarrassing copy paste error. I hope it's all fixed now.
Test 10 still test for emptiness with isequal.
Test suite has been updated to include row vectors as test cases as well.
Solution Comments
Show commentsProblem Recent Solvers7
Suggested Problems
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15485 Solvers
-
Number of 1s in the Binary Representation of a Number
442 Solvers
-
Create a function handle that reverses the input arguments of another function handle
149 Solvers
-
203 Solvers
-
13889 Solvers
More from this Author5
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!