Input a vector whose number of elements is NaN. Let's replace the NaN elements in the vector with the previous value.

1 回表示 (過去 30 日間)
help me :Input a vector whose number of elements is NaN. Let's replace the NaN elements in the vector with the previous value.

回答 (1 件)

Chunru
Chunru 2021 年 9 月 5 日
A = [1 3 NaN 4 NaN NaN 5];
F = fillmissing(A,'previous')
F = 1×7
1 3 3 4 4 4 5

カテゴリ

Help Center および File ExchangeNaNs についてさらに検索

タグ

製品


リリース

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by