Filter löschen
Filter löschen

Find does not work according to the condition?

2 Ansichten (letzte 30 Tage)
Rida
Rida am 8 Mär. 2015
Kommentiert: Guillaume am 8 Mär. 2015
Hi All I have a vector having values such as [0.6089 0.5798 0.5711 and so on] I want to set a threshold to discard values greater than 0.5798, but when I run
find(my_gauss>0.5798) I get this: ans =
Empty matrix: 1-by-0
Kindly explain
  1 Kommentar
Guillaume
Guillaume am 8 Mär. 2015
As per Jan's answer, the issue is not with the line you've shown.
In any case, if all you want to do is remove values above a threshold, you don't need find:
my_gauss(my_gauss > 0.598) = []; %delete values above threshold
If find doesn't find anything, then the above won't discard anything either.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Jan
Jan am 8 Mär. 2015
Bearbeitet: Jan am 8 Mär. 2015
There is another problem in your code. So please post a running piece of code which reproduces the problem. See:
my_gauss = [0.6089 0.5798 0.5711]
find(my_gauss > 0.5798)
ans = 1
If you get another answer, you run some code, which is not shown or explained in your question.

Weitere Antworten (0)

Kategorien

Mehr zu Graphics Object Programming 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