Problem 2010. Wrap a vector, but insert NaN's at the wrap-positions.
Solution Stats
Problem Comments
-
2 Comments
a couple of issues: 1) I believe you are missing the input 'm' to wrapnan in your testsuite; 2) some numerical precision issues arise in the last test (e.g. rem(.8,.5)-.3 returns ~.5e-17), perhaps you could just round to two decimals the output of wrapnan so that we do not have to?
I fixed it. Thank you for reminding me. You might submit a shorter solution now.
Solution Comments
-
3 Comments
Test Suite is currently broken due to the undefined function 'roundn' for input arguments of type 'double'.
Error in Test3 (line 5)
assert(isequaln(roundn(y,2),roundn(y_correct,2)))
Still not fixed yet...
@Lincoln Poon, It has been fixed now
-
1 Comment
ugly.
-
1 Comment
Very ['ni' 'ce'] HAHAHA
Problem Recent Solvers15
Suggested Problems
-
Extract leading non-zero digit
1546 Solvers
-
Project Euler: Problem 6, Natural numbers, squares and sums.
1481 Solvers
-
723 Solvers
-
61 Solvers
-
Justify the character string in center with proportional fonts
60 Solvers
More from this Author31
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!