The problem does not limit the array to a single row. Add a few cases of multiple rows or define as single row.
x = [1:10 NaN];
y_correct = [ 1:10 10];
1 2 3 4 5 6 7 8 9 10 NaN
Output argument "y" (and maybe others) not assigned during call to "replace_nans".
Error in Test4 (line 3)
why wont this pass?
Not really a solution, more like a "white flag" regarding this direction.
big size ...!
I just realized that you can cause inconvenience to some players by posting cody problems like "Hello Everyone!!!". I did create that cody problem just to say Hi to my fellow cody players. It was not intended to waste your time or cause inconvenience. My apologies for whoever deleted that problem.
I am sure it was deleted by mistake, there are plenty of similar Cody problems (think Chuck Norris, indian mathematicians, smartest matlab programmers, and a long etc...) Perhaps Ned can put it back up?
Thanks for the reply sir.
Strange...those assertions pass on my computer
For the second test it gives: [0 0 1 2 2 2 17 3 -4] instead of [0 1 2 2 2 17 3 -4 -4]
Nice, it is very intuitive that a solution with this function is possible but still hard to find.
It's like a lesson. logical indices don't have to be full size! And for will apparently loop through a vector! Thanks!
Bonus! Vector doesn't have to be monotonic!
Distance walked 1D
Getting the indices from a vector
03 - Matrix Variables 4
Matrix to column conversion
Word Counting and Indexing
Indexed Probability Table
Find all elements less than 0 or greater than 10 and replace them with NaN
Counting in Finnish
Most nonzero elements in row
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office