런타임 문제 검사하기
프로덕션 코드 생성 전에 시험용 MEX 함수를 생성하여 런타임 문제 검사
MATLAB® 코드가 예상대로 작동하는 생성 코드를 생성하는지 확인하려면 MATLAB 환경에서 실행할 수 있고 테스트할 수 있는 MEX 함수를 생성해 실행하십시오. 이 단계를 수행하면 생성된 프로덕션 코드에서 진단하기 어려운 런타임 오류를 감지하고 수정할 수 있습니다. 또한 생성 코드가 원래 MATLAB 함수와 동일한 기능을 제공하는지 확인할 수도 있습니다.
함수
coder.runTest | Run test replacing calls to MATLAB functions with calls to MEX functions |
도움말 항목
시험용 MEX 함수 생성하기
- Check for Issues in MATLAB Code Using MEX Functions
Use MEX functions to verify that the generated code provides the same functionality as the original MATLAB code. - Profile MEX Functions by Using MATLAB Profiler
See execution times and code coverage for generated MEX functions in MATLAB Profiler.
디버그
- Debugging Strategies
Choose a strategy for detecting and correcting code that is not suitable for code generation. - Debugging Generated MEX Code
Debug MEX code generated from your MATLAB code. - Debug Generated C/C++ Code
Debug standalone C/C++ code generated from your MATLAB code.
문제 해결하기
- 오류 해결: 코드 생성 시 함수가 지원되지 않음
지원되지 않는 MATLAB 함수의 코드 생성 실패 문제를 해결합니다. - 오류 해결: 변수를 사용하기 전에 완전히 정의해야 합니다
변수를 사용하기 전에 변수가 정의되지 않은 경우에 발생하는 코드 생성 오류를 해결합니다. - Resolve Issue: Cell Array Elements Must Be Fully Defined Before Use
Troubleshoot code generation errors when cell array elements are not defined before use.