Detect a number and replace with two NaN's - MATLAB Cody - MATLAB Central

Problem 1048. Detect a number and replace with two NaN's

Difficulty:Rate

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

45.29% Correct | 54.71% Incorrect
Last Solution submitted on Mar 22, 2025

Problem Comments

Solution Comments

Show comments
LLMs with MATLAB updated to support the latest OpenAI Models
Large Languge model with MATLAB, a free add-on that lets you access...
2
3

Problem Recent Solvers193

Suggested Problems

Problem Tags

Community Treasure Hunt

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

Start Hunting!
Go to top of page