Problem 17. Find all elements less than 0 or greater than 10 and replace them with NaN
Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN.
Example:
Input x = [ 5 17 -20 99 3.4 2 8 -6 ] Output y is [ 5 NaN NaN NaN 3.4 2 8 NaN ]
Solution Stats
Problem Comments
-
15 Comments
Show
12 older comments
Kaia Iverson
on 12 Dec 2020
cool problem!
Derek McCandless
on 12 Dec 2020
goog
Michael
on 28 Nov 2022
good problem to learn!
Solution Comments
Show commentsProblem Recent Solvers15609
Suggested Problems
-
Remove all the words that end with "ain"
2396 Solvers
-
Remove the small words from a list of words.
1526 Solvers
-
It dseon't mettar waht oedrr the lrettes in a wrod are.
1899 Solvers
-
Project Euler: Problem 4, Palindromic numbers
1146 Solvers
-
Convert a vector into a number
603 Solvers
More from this Author96
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!