matlab.unittest.constraints.HasNaN 클래스
패키지: matlab.unittest.constraints
슈퍼클래스: matlab.unittest.constraints.BooleanConstraint
NaN 값을 포함하는 배열을 규정하는 제약 조건
생성
HasNaN
은 실제 값 배열의 값이 하나라도 NaN
인지 확인할 수 있는 제약 조건을 만듭니다. 이 제약 조건은 실제 값 배열이 하나 이상의 NaN
값을 포함하는 경우에만 충족됩니다.
복사 의미 체계
값입니다. 값 클래스가 복사 작업에 미치는 영향에 대한 내용은 객체 복사 항목을 참조하십시오.
예제
실제 값 배열이 NaN 값을 포함하는지 테스트
대화형 방식 테스트를 위한 테스트 케이스를 생성합니다.
import matlab.unittest.TestCase import matlab.unittest.constraints.HasNaN testCase = TestCase.forInteractiveUse;
값 NaN
이 제약 조건을 충족하는지 테스트합니다.
testCase.verifyThat(NaN, HasNaN)
Interactive verification passed.
배열이 NaN 값을 포함하는지 어설션합니다.
testCase.assertThat([0 1 1 2 3 5 8 13], HasNaN)
Interactive assertion failed.
---------------------
Framework Diagnostic:
---------------------
HasNaN failed.
--> At least one element must be NaN.
Actual double:
0 1 1 2 3 5 8 13
Assertion failed.
이 배열은 NaN 값을 포함하지 않습니다.
배열이 NaN 값을 포함하는지 확인합니다.
testCase.verifyThat([-Inf 5 NaN], HasNaN)
Interactive verification passed.
복소수가 제약 조건을 충족하는지 어설션합니다.
testCase.assertThat(42+NaN*1i, HasNaN)
Interactive assertion passed.
배열이 NaN
값을 포함하지 않는지 확인합니다.
testCase.verifyThat([Inf -7+Inf*1i], ~HasNaN)
Interactive verification passed.
HasNaN
제약 조건을 부정한다고 해당 값이 유한한 값임을 보장하지 않습니다. 단지 NaN
값이 없음을 보장할 뿐입니다.
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)