Replacement of Nan to 2.74

조회 수: 3 (최근 30일)
ali tefeili
ali tefeili 2019년 12월 29일
댓글: Rasim Tawfeeq 2020년 5월 27일
One of the elements in the usage variable has a value of NaN. Replace this value with the value 2.74.
How can i write this ??
  댓글 수: 3
Sohail Ahmad
Sohail Ahmad 2020년 2월 20일
array-name (Row,Column)=2.74
Rasim Tawfeeq
Rasim Tawfeeq 2020년 5월 27일
usage (2,3)=2.74

댓글을 달려면 로그인하십시오.

답변 (2개)

Star Strider
Star Strider 2019년 12월 29일
Use the isnan function to detect it and its location. Since this seems to be a homework problem, I leave the rest to you. (If it is not a homework probllem, I will provide a more detailed Answer.)
  댓글 수: 2
ali tefeili
ali tefeili 2019년 12월 30일
Thankyou,what if i know in which row und column it is ?
Star Strider
Star Strider 2019년 12월 30일
My pleasure.
Use the find function. See the documentation to understand how to get both the row and column indices.

댓글을 달려면 로그인하십시오.


Steven Lord
Steven Lord 2020년 2월 20일
You could use the fillmissing function to fill the location of your missing data (NaN for double and single precision variables) with a constant. It will also allow you to specify different methods to fill that missing data (several types of interpolation, values that are "around" the missing data, or moving average or median.)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by