matlab.unittest.constraints.IsFinite 클래스
패키지: matlab.unittest.constraints
슈퍼클래스: matlab.unittest.constraints.BooleanConstraint
유한한 값을 규정하는 제약 조건
생성
IsFinite
는 실제 값 배열의 모든 값이 유한한지 확인할 수 있는 제약 조건을 생성합니다. 이 제약 조건은 실제 값 배열이 무한대 값 또는 NaN
값을 포함하지 않는 경우에만 충족됩니다.
복사 의미 체계
값입니다. 값 클래스가 복사 작업에 미치는 영향에 대한 내용은 객체 복사 항목을 참조하십시오.
예제
실제 값 배열이 유한한 값만 포함하는지 테스트
대화형 방식 테스트를 위한 테스트 케이스를 생성합니다.
import matlab.unittest.TestCase import matlab.unittest.constraints.IsFinite testCase = TestCase.forInteractiveUse;
값 17
이 제약 조건을 충족하는지 테스트합니다.
testCase.verifyThat(17, IsFinite)
Interactive verification passed.
배열이 완전히 유한한지 어설션합니다.
testCase.assertThat([0 1 1 2 3 5 8 13], IsFinite)
Interactive assertion passed.
배열이 완전히 유한한지 확인합니다.
testCase.verifyThat([-Inf 5 NaN], IsFinite)
Interactive verification failed. --------------------- Framework Diagnostic: --------------------- IsFinite failed. --> All elements must be finite-valued. Failing indices: 1 3 Actual Value: -Inf 5 NaN
이 배열은 무한대 값을 포함합니다.
허수부가 무한대인 복소수가 제약 조건을 충족하는지 테스트합니다.
testCase.assertThat(42+Inf*1i, IsFinite)
Interactive assertion failed. --------------------- Framework Diagnostic: --------------------- IsFinite failed. --> The value must be finite. Actual Value: 42.000000000000000 + Infi Assertion failed.
배열이 유한한 값을 일부 포함하지 않는지 확인합니다.
testCase.verifyThat([NaN -7+NaN*1i], ~IsFinite)
Interactive verification passed.
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)