How to replace/exlude certain values from data array/plot
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentar
MiguelMauricio
am 26 Mai 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)
Antworten (1)
Roger Wohlwend
am 26 Mai 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 Kommentare
Siehe auch
Kategorien
Mehr zu Annotations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!