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

8 ビュー (過去 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 Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by