코드 검증
생성 코드의 동작 검증, 추적성, 코드 생성 리포트
생성된 MEX 코드의 출력값을 원래 MATLAB® 코드와 대조해 테스트하거나 MATLAB 단위 테스트 클래스를 기반으로 사용자 지정 테스트를 생성할 수 있습니다. 코드 실행 중에 발생하는 오류를 알려주는 런타임 오류 검사를 생성하도록 선택할 수 있습니다.
함수
codegen | MATLAB 코드에서 C/C++ 코드 생성 |
coder.config | 코드 생성 구성 객체 만들기 |
coder.mfunctionname | Name of calling function or method (R2021b 이후) |
coder.runTest | Run test replacing calls to MATLAB functions with calls to MEX functions |
도움말 항목
생성 코드 테스트
- Testing Code Generated from MATLAB Code
Verify numerical behavior of generated code. - Verify MEX Functions in the MATLAB Coder App
Compare results of running the original MATLAB function with the results from running the MEX function. - Verify MEX Functions at the Command Line
Test MEX functions withcoder.runTestor thecodegen-testoption. - Unit Test Generated Code with MATLAB Coder
Run MATLAB unit tests on generated code. - Unit Test External C Code with MATLAB Coder
Run MATLAB unit tests on generated code that integrates external C code.
런타임 오류 감지
- Generate Standalone C/C++ Code That Detects and Reports Run-Time Errors
Generate standalone libraries and executables that detect and report run-time errors, such as out-of-bounds array indexing.
