How to replace/exlude certain values from data array/plot
8 views (last 30 days)
Show older comments
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 Comment
MiguelMauricio
on 26 May 2014
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)
Answers (1)
Roger Wohlwend
on 26 May 2014
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.
0 Comments
See Also
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!