Replace one NAN with zero in a row vector without a loop

1 回表示 (過去 30 日間)
Zeynab Mousavikhamene
Zeynab Mousavikhamene 2019 年 8 月 19 日
回答済み: Raj 2019 年 8 月 19 日
I have a row vector that its size is changing in each run. Some of its elements might be NAN and I want to replace those with zero.
How can I do that without need to have a loop? isnan(A) finds nan values but I need to replace and I want to avoid loop.

採用された回答

Raj
Raj 2019 年 8 月 19 日
A(isnan(A)) = 0; % replaces NAN elements of A matrix by Zero.

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by