Filter löschen
Filter löschen

Want to remove 'noise' from a matrix.

5 Ansichten (letzte 30 Tage)
OliK
OliK am 8 Okt. 2015
Kommentiert: Image Analyst am 8 Okt. 2015
I have a single column matrix with values ranging from around -15 to 50, there's around 19000 values and I wish to remove any values below 20 and set them as 0. This is what I currently have to import the data:
input = xlsread('HiG_67.csv','J:J');
Thanks
  1 Kommentar
Stephen23
Stephen23 am 8 Okt. 2015
Do not call your variable input as this is the name of a commonly used inbuilt function input. When you shadow the name of an inbuilt function like this it stops the inbuilt function from working.
For this reason never use the names size, length, input, i, j, cat, length, etc. You can use which to check if a name is already used-

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Dennie
Dennie am 8 Okt. 2015
If input is a non-negative single column then you can use the following simple filter:
FilterValue=20;
input(input<FilterValue)=0;
If there are also negative values that you wish to keep then you can try:
input(abs(input)<FilterValue)=0;
If you only want to filter the positive noise:
filter=input<FilterValue & input>=0;
input(filter))=0;
Dennie
  4 Kommentare
OliK
OliK am 8 Okt. 2015
Is there a way I can do it without Signal Processing Toolbox?
Image Analyst
Image Analyst am 8 Okt. 2015
There are peak detectors in the File Exchange.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Thorsten
Thorsten am 8 Okt. 2015
Bearbeitet: Thorsten am 8 Okt. 2015
x(x < 20) = 0;
BTW: Please don't call your variable input, it's a Matlab function.

Community Treasure Hunt

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

Start Hunting!

Translated by