replace "inf " with a value

조회 수: 15 (최근 30일)
maryam
maryam 2015년 2월 14일
댓글: maryam 2015년 2월 14일
hi all. i have a 8192*300 matrix. some of its elements are "inf". i want to replace these values with average of cells before and after them. could you give me an advice? thank you very much
  댓글 수: 3
per isakson
per isakson 2015년 2월 14일
편집: per isakson 2015년 2월 14일
maryam
maryam 2015년 2월 14일
Dear Stephen, thank you for your reply. one cell from each side is enough. but i don't have any idea about your next questions! :(

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

답변 (1개)

Stephen23
Stephen23 2015년 2월 14일
편집: Stephen23 2015년 2월 14일
Use TriScatteredInterp or scatteredInterpolant (newer MATLAB versions). You can pass these vectors of your data points excluding the Inf values, and then they will interpolate new points at the grid locations that you specify.
  댓글 수: 1
maryam
maryam 2015년 2월 14일
thank you very much, i will test this method. but should i have matlab 2014b? my current version is 2012b.

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by