How to replace/exlude certain values from data array/plot
2 次查看(过去 30 天)
显示 更早的评论
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
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
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!