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

Learn moreOpportunities for recent engineering grads.

Apply TodayWrite 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]

77 correct solutions
95 incorrect solutions

Last solution submitted on Jul 19, 2014

1 player likes 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