Input a vector whose number of elements is NaN. Let's replace the NaN elements in the vector with the previous value.
Show older comments
help me :Input a vector whose number of elements is NaN. Let's replace the NaN elements in the vector with the previous value.
Answers (1)
A = [1 3 NaN 4 NaN NaN 5];
F = fillmissing(A,'previous')
Categories
Find more on NaNs in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!