How can I change all values in a matrix above a threshold to a different number?

23 Ansichten (letzte 30 Tage)
The dataset I am working with contains some elements with very high values occurring due to artifact during measurement. Is there a way to take all elements in an array greater than value X and change them to value X?

Akzeptierte Antwort

Image Analyst
Image Analyst am 4 Sep. 2018
Try this:
signal = min(signal, X);
Or you can do this
signal(signal > X) = X

Weitere Antworten (0)

Kategorien

Mehr zu Multidimensional Arrays 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!

Translated by