%% Vector with NaN Values
% Create a vector that contains NaN values and replace each NaN with the previous non-missing value.

A = [1 3 NaN 4 NaN NaN 5];
F = fillmissing(A,'previous')

% Copyright 2012 The MathWorks, Inc.