Problem 42480. Go back n times
You will be given a column vector (such as x = [1; 2; 3; 4; 5; 6]). If (n=3) you will return following;
[ 1 NaN NaN NaN 2 1 NaN NaN 3 2 1 NaN 4 3 2 1 5 4 3 2 6 5 4 3 ]
Solution Stats
Problem Comments
-
4 Comments
Show
1 older comment
Alfonso Nieto-Castanon
on 31 Jul 2015
I imagine you are going to need to use "isequalwithequalnans" in your testsuite instead of "isequal" for this problem
Mehmet OZC
on 1 Aug 2015
Now, I have changed the assert statement
Massimo Zanetti
on 26 Oct 2016
Example is wrong. Input vector x must be
x = [1; 2; 3; 4; 5; 6]
not
x = [1; 2; 3; 4; 5; 6; 7; 8]
Aditya Jain
on 26 Oct 2016
Thanks Massimo. Changed it
Solution Comments
Show commentsProblem Recent Solvers43
Suggested Problems
-
Back to basics 11 - Max Integer
785 Solvers
-
Remove the two elements next to NaN value
651 Solvers
-
Find out missing number from a vector of 9 elements
299 Solvers
-
Put Two 1D matrices into one 1D matrix
134 Solvers
-
458 Solvers
More from this Author92
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!