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

조회 수: 2 (최근 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 CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by