MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

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]

110 correct solutions
123 incorrect solutions

Last solution submitted on Apr 15, 2015

2 players like this problem

1 Comment

James
on 27 Nov 2012

I wrote this solution when there were multiple problems with the test suite. It's an ugly hack, and not a "real" solution. Now that the test suite is working, please ignore this solution.

13 Comments