Problem 44475. Determine given vector is even or odd
Find the numbers of the input vector is odd or even then replace even with 1 and odd with 0
Example
x = [ 3 3 4 6 1] The output is [0 0 1 1 0]
Solution Stats
Problem Comments
-
3 Comments
Yeo Kai Shun
on 5 Jan 2018
Thanks for the question!
Sashi Kumar
on 5 Jan 2018
yeah it's great exercise
József Jónás
on 31 Mar 2022
Nice!
Solution Comments
Show commentsProblem Recent Solvers74
Suggested Problems
-
Project Euler: Problem 5, Smallest multiple
1647 Solvers
-
Matrix indexing with two vectors of indices
772 Solvers
-
314 Solvers
-
244 Solvers
-
Convert from Fahrenheit to Celsius
27595 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!