Hi, i have to write this condition in my code but i don't know how
moyenne <= '(-inf-6.95]'

1 件のコメント

Jan
Jan 2017 年 5 月 23 日
Are you aware that the notation, you have invented, is not clear or unique? What exactly does the smaller than operator do with a string? What exactly is (-inf-6.95] ?
Do you mean: Moyenne is > -Inf and small or equal -6.95?

サインインしてコメントする。

回答 (2 件)

dpb
dpb 2017 年 5 月 23 日
編集済み: dpb 2017 年 5 月 24 日

0 投票

Can't. Comparison operations always return logical 0 (false) where A or B have NaN elements.
Best you can do is test if result isfinite or not. See
doc isfinite % and friends for more information
ADDENDUM
OK, w/ the additional background try
Ayup...
moyenne<=-6.95
would give everything <= the breakpoint into that region, up to as large a negative value as can be represented. If the model can/does generate -Inf, that will have to be special-cased.
Jan's guess wasn't too far off, looks like
if sign(moyenne)*isinf(moyenne)==-1 | moyenne<=-6.95 % handle -Inf, too...
should do it. The first tests for -Inf and the other takes the case is finite but < than the breakpoint.
Do the similar thing on an unbounded upper bin as well.
Jan
Jan 2017 年 5 月 23 日

0 投票

A bold guess:
isfinite(moyenne) & moyenne <= -6.95

9 件のコメント

afef
afef 2017 年 5 月 23 日
i mean moyenne is smaller or equal to the interval from minis infinite to 6.95
Torsten
Torsten 2017 年 5 月 23 日
???
dpb
dpb 2017 年 5 月 23 日
If it is finite it's smaller; the interval including -Inf is, well, "infinite", at least to the best representation can make digitally.
As noted above, you can't do anything with Inf computationally other that test whether a value is/is not finite. As soon as you bring Inf into any construct, the result is another Inf or perhaps NaN which is of no real benefit either.
Jan
Jan 2017 年 5 月 23 日
@afef: What does "smaller or equal to an interval" mean? What is the contents of "moyenne"? Is it a scalar number or two numbers to repesent an interval? You still let us guess, what you want to achieve. Please explain it in a clear sentence: "Moyenne has [e.g.] the value [...] and I want to get the result [true/false] it is [larger than -Inf and smaller than -6.95]".
I have suggested some code. Did you try it? Does it work? If not, what is the difference between the result and what you want?
dpb
dpb 2017 年 5 月 23 日
"moyenne is smaller or equal to the interval from minis infinite to 6.95"
Is this a cumulative distribution function or the like, mayhaps???
Tell us what the context is and maybe we can figure out something...as a standalone, it's likely what you've gotten is best can do...
afef
afef 2017 年 5 月 24 日
actually i used the AntMiner+ algorithm for classification and it give me a decision list that i used in my code to test this given rule . Also this algorithm does not handle numeric values so they will be descritized so this is why i get this interval
dpb
dpb 2017 年 5 月 24 日
Then it's simply binning and everything <-6.95 goes to the first bin; you don't need to describe the lower limit at all.
afef
afef 2017 年 5 月 24 日
編集済み: afef 2017 年 5 月 24 日
Ok so i should just put moyenne <= 6.95 ?
dpb
dpb 2017 年 5 月 24 日
編集済み: dpb 2017 年 5 月 24 日
Yeah; expanded answer above based on comment...

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeData Import and Export についてさらに検索

製品

タグ

質問済み:

2017 年 5 月 23 日

編集済み:

dpb
2017 年 5 月 24 日

Community Treasure Hunt

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

Start Hunting!

Translated by