using ismembertol contradictory results
    조회 수: 2 (최근 30일)
  
       이전 댓글 표시
    
when I write this I get the following results
>>ismembertol(117 , 115 , 1e-2)
ans =
     0
and when I write this I get the following results
>> ismembertol(117 ,[ 115 366], 1e-2)
ans =
     1
for me the results are contradictory maybe it is because i do not understand properly the function
댓글 수: 0
채택된 답변
  Jan
      
      
 2017년 3월 6일
        According to the doc s the tolerance is applied as:
abs(u-v) <= tol*max(abs([A(:);B(:)]))
In your case this is:
abs(117 - 115) <= 1e-2 * max(abs([117; 115])))
2 <= 1e-2 * 117   % ==> FALSE
But when the maximum of the values is 366 you get:
abs(117 - 115) <= 1e-2 * max(abs([117; 115, 336])))
2 <= 1e-2 * 336   % ==> TRUE
This means, that the results are as explained in the doc ismembertol: relative to the largest input value.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
				Help Center 및 File Exchange에서 Object Containers에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

