Given several vectors contained within one vector delimited by NaNs, return each individual vector as an element of a cell vector.
Given several matrices combined in one matrix delimited by all-NaN rows , return each matrix as an element of a cell vector.
Solution Stats
Problem Comments
5 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers8
Suggested Problems
-
Maximum running product for a string of numbers
2253 Solvers
-
1060 Solvers
-
Create a cell array out of a struct
2412 Solvers
-
13220 Solvers
-
Set the array elements whose value is 13 to 0
1436 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!
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.