필터 지우기
필터 지우기

How to replace/exlude certain values from data array/plot

조회 수: 2 (최근 30일)
Lukas
Lukas 2014년 5월 26일
댓글: MiguelMauricio 2014년 5월 26일
Hey Folks,
I have the following problem: I have SAR-scenes with readings in dB. In some cases the scenes have an edge with values of -1.0E-30. When I plot the data I get a series of data points around 0, which distort the result (see attached picture). I tried to replace these values with the following code:
if true
% SAR_20070116(SAR_20070116 == -1.0e-30)=nan;
end
Unfortunately, the values were not overwritten. Does anyone know how to solve this problem?
  댓글 수: 1
MiguelMauricio
MiguelMauricio 2014년 5월 26일
Let's say you want to remove the data lower than 1e-30. What about?
newArray=oldArray(oldArray>1e-30)
and your horizontal value array becomes
xNew=xOld(oldArray>1e-30)

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

답변 (1개)

Roger Wohlwend
Roger Wohlwend 2014년 5월 26일
The problem is that the values are probably not exactly 1.0E-30 but something like 0.9876E-30 or 1.0003E-30. That is why your code does not work. Try the following:
SAR(abs(SAR) < 1E-20) = NaN;
The threshold 1E-20 is chosen arbitrarily. You can choose a different value, if you like.

카테고리

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