Replace multiples of 5 with NaN - MATLAB Cody - MATLAB Central

Problem 1194. Replace multiples of 5 with NaN

Difficulty:Rate

It is required to replace all values in a vector that are multiples of 5 with NaN.

Example:

 input:   x = [1 2 5 12 10 7]
 output:  y = [1 2 NaN 12 NaN 7]

Solution Stats

57.11% Correct | 42.89% Incorrect
Last Solution submitted on Jun 12, 2025

Solution Comments

Show comments
Why should you share code?
In a discussion on LInkedin about my recent blog post, Do these...
1
2

Problem Recent Solvers451

Suggested Problems

More from this Author11

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!