Problem 1048. Detect a number and replace with two NaN's
Write code which replaces the number 1 with two NaNs.
Example
X = [ 1 2 NaN 4 1 3 7 NaN 1 4 NaN 2]
Answer Y is
[ NaN NaN 2 NaN 4 NaN NaN 3 7 NaN NaN NaN 4 NaN 2]
Solution Stats
Problem Comments
-
13 Comments
Show
10 older comments
Ned Gulley
on 27 Nov 2012
I updated the test suite with the suggestions made here. I believe it works now.
Jean-Marie Sainthillier
on 29 Nov 2012
The particular number is 1
Andrew Newell
on 19 Jun 2013
This problem would be much better if the "particular number" was one of the arguments to the function.
Solution Comments
Show commentsProblem Recent Solvers192
Suggested Problems
-
Given an unsigned integer x, find the largest y by rearranging the bits in x
1857 Solvers
-
386 Solvers
-
Reverse the elements of an array
1040 Solvers
-
314 Solvers
-
Sum of odd numbers in a matrix
588 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!